PHP Caching Files (.htaccess) -


i have following code using website. know if code correct in order me cache me pages , files. have tried use tools check don't see caching.

<ifmodule mod_headers.c>     # 1 month     <filesmatch ".(ico|gif|jpg|jpeg|png|pdf)$">         header set cache-control "max-age=2419200"     </filesmatch>      # 1 week     <filesmatch ".(css|js)$">         header set cache-control "max-age=604800"     </filesmatch>      # 1 day     <filesmatch ".(htm|html)$">         header set cache-control "max-age=86400"     </filesmatch> </ifmodule> 

catching automatic mechanism of browsers. when page loading, browser checks cache static files js, css, images..., if not available browser pus them cache.

to determine whether file cached or not, check firebug console , clik on request link.

here can see information like

    accept-ranges   bytes     cache-control   max-age=290304000, public     content-encoding    gzip     content-length  2824     content-type    application/javascript     date    thu, 11 jul 2013 10:15:06 gmt     expires fri, 12 jul 2013 10:15:06 gmt     last-modified   thu, 03 jan 2013 16:05:54 gmt     server  apache     vary    accept-encoding,user-agent 

Comments