On reentering the cached content etag is not validating

6854933580_2c8b688306_z

Error Banner.fade_out.modal_overlay.modal_overlay .modal_wrapper.modal_overlay [email protected](max-width:630px)@media(max-width:630px).modal_overlay .modal_fixed_close.modal_overlay .modal_fixed_close:before.modal_overlay .modal_fixed_close:before.modal_overlay .modal_fixed_close:before.modal_overlay .modal_fixed_close:hover:before.

We have at least three approaches we can take to help achieve these goals: We can reduce the need for clients to make multiple network connections to the site, we can provide ways for clients to validate whether they need to re-download a page that they've previously downloaded, and we can provide clients "freshness" information telling them how long they can keep copies of pages without having to revalidate them.

One of the validators for HTTP is the HTTP/1.1 200 OK Date: Fri, GMT Server: Apache ETag: "11c415a-8206-243aea40" Accept-Ranges: bytes Content-Length: 33286 Vary: Accept-Encoding, User-Agent Cache-Control: max-age=7200 Expires: Fri, GMT Content-Type: image/png -- binary data --HTTP/1.1 200 OK Date: Fri, GMT Server: Apache ETag: "0192384-9023-1a929893" Accept-Ranges: bytes Content-Length: 33286 Vary: Accept-Encoding, User-Agent Cache-Control: max-age=7200 Expires: Fri, GMT Content-Type: image/png -- binary data -- can appear in both request headers and response headers, which gives both the client and server a chance to assert how old they like their responses cached.

If a cached response is fresh then we can return the cached response immediately; if it's stale then we need to validate the cached response before returning it.

My goal is to explain how the HTTP protocol actually works in this context (as opposed to just saying "do this" without explaining why) while at the same time avoiding "protocol geekery" that's irrelevant to the problem at hand.

Suppose that you have a blog (or other web site) whose content is generated dynamically in response to incoming requests.

And for optimization purposes, it will include the “Last-Modified” header value in a request.

You must have an account to comment. Please register or login here!