Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on a slightly flaky connection and I'm trying to improve my browsing experience with the use of a local proxy. According to my research, however, if I hit 'enter' in my browser on an existing URL, it'll send a Cache-Control: max-age=0 header to the proxy, which will, in turn, make round-trips to the server to revalidate the content.

I don't particularly want this; if the object is stale, the cache will re-fetch it, but if it's not stale I don't see why I'd want the object revalidated every freakin' time. If I suspect the page is old, I've got shift-F5 and I'm not afraid to use it.

So, is there a tunable somewhere behind the scenes in Chrome that'll turn this annoying behaviour off?

share|improve this question

I have found that if you browse to a page through your back-button or a link, Chrome doesn't send the max-age=0 header and will usually (if the apache server on the other side is configured for caching) use a cached version of the page.

However, when you enter the URL (e.g. directly into the address bar and then press Return, Chrome will always send the Cache-Control: max-age=0 header, which circumvents caching.

share|improve this answer

It is possible to modify the headers Chrome sends to a webserver using either userscripts (ala greasemonkey) or extensions. Here is one extension that should work: ModHeader

According to the introduction and screenshot, adding a header such as cache-control max-age=1000 should be relatively straightforward. It also supports domain whitelists to prevent headers from being sent to specific websites. You may need enable certain experiments in chrome://flags for this work.

demo of adding headers

share|improve this answer

Browsers behave based on the response headers they receive. If the browser receives response headers like

Cache-Control: private
Expires: Thu, 01 Jan 1970 00:00:00 UTC

then, browser would always request with Cache-Control: max-age=0. This usually happens with Tomcat container, where the BaseAuthenticator adds these response headers when the variable disableProxyCaching is true. If you are facing similar issue, you can visit this link for solution.

Hope this helps to a certain extent :)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .