Cashy My Apache
July 18, 2007 5:49 PM Subscribe
I am attempting to configure caching on an Apache server. I have it right for the most part, but.....I would like to prevent browsers from even checking the server once files like images are in the browser cache until an expiry date is exceeded.
posted by jasondigitized to computers & internet (2 answers total)
As an example, I am placing this in my httpd.conf file:
Header add "Expires" "Mon, 28 Jul 2014 23:30:00 GMT"
Header add "Cache-Control" "max-age=31536000"
mod_expires and mod_headers are turned on. According to Firebug, all of my images are 'caching', but my browser is still checking the server, and is receiving a '304 Not Modified' message. The is good, but not good enough. How can I prevent the browser from checking the server. Once that image is in the cache, I don't want my browser checking the server until after the expiry or max-age is exceeded. Is this possible? According to this article
, "You can prevent the contact with the server from happening at all by using the Expires header and the Cache-control header."