I would like to cache a particular image on my website i.e the background image.

So far i only see options that allow you to define the format type(png|jpg|ico) is there anyway to let the browser cache the background


I use the following to set far future expiration dates for all media files:

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|ico|js|css|swf)(\.gz)?$">
Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
Header unset ETag
FileETag None

and I'd recommend using it because it will help out on the bandwidth and speed front's but this code would allow you to set the expiry for a specific file.

<Files "test1.jpg">
  ExpiresActive On
  ExpiresDefault A60

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.