Hi,
I’m very new to using the Cache Control in PHP.
I’m keen to see what others typically use in their PHP Applications.
I suppose it depends on what the site is about and what kind of files are delivered.
Typically I use the following for most of my sites:
# 480 weeks
<FilesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>
# 2 HOURS
<FilesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
I got it from here: http://www.askapache.com/htaccess/apache-speed-cache-control.html
Also, how does the user retrieve a NEW version of a PDF of the same file name? If, say, a new PDF was uploaded with the same file name as a previous one, how do you force the user to view the new version?
Thanks for your thoughts.