Cashy My Apache
July 18, 2007 5:49 PM   RSS feed for this thread 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.

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."
posted by jasondigitized to computers & internet (2 comments total)
I don't know, but there is a bit of a conflict with your "Expires" and "Cache-Control" headers. In one, you say the content is fresh for about 10 years. The other, only 1 year. Perhaps the browser is getting confused.
posted by sbutler at 6:03 PM on July 18, 2007


I believe what you are seeing is a browser setting. Some of the browser settings can override the strict interpretation of the http caching rules. For example the IE setting to Always check the server for new versions of web pages will cause the behavior that you are seeing.
posted by mmascolino at 10:06 PM on July 18, 2007


« Older I have noticed that over the p...   |   My boss has an auto insurance ... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Disagreement with co-web developer about speed... May 7, 2008
Firefox Plug-in similar to Apple's Spaces? January 7, 2008
Algorithm Challenge! December 16, 2007
Getting from point A to B (the right way) October 11, 2007
How do I rearrange my data to make the best use of... May 2, 2006