Turning cache off for specific files
Today I wanted to solve the issue of caching on the email signature banners once and for all. I don’t want any browsers or email clients to cache the image, so I started searching for solutions.
The best one I could find was this one:
<Files {FILENAME}>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</Files>
So specifically to stop caching on the email signature file, I created an .htaccess file containing this:
<Files emailsignature.gif> FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" </Files>
And saved the file here:
windeurope.org/wp-content/uploads/images/banners/.htaccess
No comments yet.