Hi, I have a problem with pdf files on my site that are being replaced from time to time by pdf files with the same name (updates). Users reporting that they still see the old, not updated files, so assuming they have some kind of browser cache, I'm trying to force their browsers loading the new files. I have tried the following code on the .htaccess RewriteEngine On # disable caching for dynamic files <FilesMatch "\.(txt|pdf)$"> Header set Cache-Control: "max-age=0, no-store" </FilesMatch> Code (markup): It didn't help and some still reporting they see the old files. How can I disable any cache for any pdf on the site and force them to load the new files ?? Thanks.
try this # disable caching for dynamic files <FilesMatch "\.(txt|pdf)$"> ExpiresActive On ExpiresDefault A1 Header set Cache-Control "max-age=0, no-store, must-revalidate" </FilesMatch> Code (markup): If you have mod_expire enabled, this should work without errors, else, remove the first Expire* directives, the "Header ser" directive should be enough, you have to use the header name without ':' after it.
Thanks for the help. Yes, the code as is caused a 500 server error, so I've removed the Expire* directives.. However, some people still reporing that they see the old files.. It drives me insane because I don't know what else can I do... Any idea ?