I know that http caching and sending 304 response is to save some bandwidth and of course some load time.

However in my web site there are about 40 css stylesheet files and 20 javascript files (don't ask me why)

I know that would be a great idea to combine most of them into one and reduce HTTP requests.

However my question is. Is there actually a way of caching when browser wouldn't even make requests for certain resources for some time? Because making requests and even getting 304 response is still some work.

2 Answers 2


The best way is to set a max-age directive in the cache-control header. Specifically:

Cache-control: public,max-age=2592000

2592000 is the number of seconds you wish the file to be cached for (in this example it is 30 days ie 60x60x24x30).

Do note however, that many users visit websites with empty caches, so downloading all those files in the first place is a massive overhead. You should cut those down to at most 2 JS and 2 CSS files.


Yes, read this detailed article/video: https://developers.google.com/speed/articles/caching

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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