0

I'm caching our generated images using the HTTP header "Cache-Control", however, when I don't cache the HTML file (comprising those img tags) using "no-cache" I see further requests sent to the server (as I add, remove, and re-add those tags). Caching the HTML file results in cached images (and no further requests).
The Only similar case I could find is this.
Any lead/link will be appreciated.

Browser: Version 32.0.1661.0 canary Aura
p.s. I very much prefer keeping the HTML file not cached.

4
  • If you check in the web server log, is it sending an HTTP status code of 304, i.e. "Not modified"? If so, the server will not be re-sending the image. Commented Oct 13, 2013 at 17:12
  • I get Status Code:200 OK (every time) Commented Oct 13, 2013 at 17:13
  • For Chrome, 200 OK doesn't necessarily mean the request ever left the client. In many cases the response is a re-transmit of the cached version and never hits the server. The status will be 200, which makes sense, but the status message would be OK (not 'cached') which drove me crazy at some point. The only distinctions I could find between these responses and actual responses were: a missing Connection header (which otherwise is almost always present) and a Date header with a value preceding the request sent. Are your requests actually hitting the server? Commented Oct 13, 2013 at 18:50
  • @OphirRadnitz, I used a debugger on the server :) Commented Oct 14, 2013 at 9:13

1 Answer 1

6

Eugene Olshenbaum answered on twitter: "close developer tools, when it is open, chrome ignores headers :))" The cache was "disabled" while the dev tools were open. Not sure why I didn't see any calls to the server if the HTML file was cached.

Sign up to request clarification or add additional context in comments.

1 Comment

This. Even though "disable caching" wasn't ticked, I wasn't seeing any resources loading "from cache", and had a high TTFB. Closing the dev tools inspector then caused images to load instantly, from cache. Seems cache control headers are ignored.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.