Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've always used mod_expires to set caching of images etc. for a frontend performance gain, i.e. to reduce website load times.

As the browser will go to it's cache rather than the server, the number of HTTP requests will be reduced.

Will this have any noticeable performance gain from the point of view of a reduced load on the Apache server?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Yes, provided you have set a sensible expiry time then browsers don't have to come back to your server each time to ftch the content. There are a lot (and with the growing scarcity o IPV4 addresses) an increasing number of caching proxies out there - the world wide web is a CDN (but obviously not for HTTPS).

That your server does not have to deliver content each time reduces the amount of work it has to do, hence making more resources available for serving up the non-cached content.

It will have a massive impact at the client. You should be able to see this yourself using tools such as firebug.

Note that it can actually have an adverse impact on performance if the cache goes stale and you start getting conditional requests / 304 responses (use mod_headers to trip if-none-match and if-modified-since for content items which are not huge).

share|improve this answer

Most likely, yes, but you should do the due diligence and compare before and after using some type of load testing tool like ab, seige or jmeter. Also examine your logs to see how much fewer requests are being made.

share|improve this answer

Yes and No.

Yes because the image will not be fully downloaed again until the expiration time you set with mod_expires is reached.

No because the damn browser (once it is closed and then opened bak on the same page) keeps anyway inquiring the server for each image, it probably checks if the image was modifed. It does not downalod it, but it stills makes a request that server has to process and to respond.

See more: http://stackoverflow.com/questions/10048740/browser-keeps-inquiring-server-for-images-that-should-stay-cached-for-1-year

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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