If-None-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4"Īn ETag is superior to Last-Modified because it works for things besides files, or things that have a notion of date.Bonus tip: Bookmark us! Other tools URL Decode URL Encode JSON Minify JSON Beautify JS Minify JS Beautify CSS Minify CSS Beautify Partner sites Number System Converter TV Show and Movie Ratings Secure Group Chat About Meet Base64 Decode and Encode, a simple online tool that does exactly what it says: decodes from Base64 encoding as well as encodes into it quickly and easily. I can perform a conditional request based on the ETag: GET / HTTP/1.1 this is what the Mozilla MDN wiki does they hash the final markup): 200 OKĮTag: "33a64df551425fcc55e4d42a148795d9f25f89d4"Īnd exactly like in the case of a conditional request based on Last-Modified: GET / HTTP/1.1 image, js, css, font), or of the cached rendered page (i.e. My ETag can be the SHA1 hash of a static resource (e.g. If I'm pulling a list of products out of a database, the server can send the last rowversion as an ETag, rather than a date: 200 OK What is ETag?ĮTag is similar to Last-Modified, except that it doesn't have to be a date - it just has to be a something. 1998) equivalent of the modern Cache-Control: max-age header:Īnd if both are specified, then the browser uses max-age: 200 OKĪny web-site written after 1998 should not use Expires anymore, and instead use max-age. The difference between "Cache-Control: max-age" and "Expires"Įxpires is a legacy (c. if you specified max-age, the browser won't even have to suffer the network round-trip the content will come right out of the caches.if you specified only Last-Modified, the browser has to perform a If-Modified-Since request, and watch for a 304 Not Modified response.The virtue of adding Cache-Control: max-age is that the browser doesn't even have to perform a "conditional" request. If it's a corporate proxy, then all 67,198 users hitting the same page in the same 15-second window will all get the same contents - all served from close cache. If the user hammers F5, they'll keep getting the cached version for 15 seconds. But I'm perfectly willing to let the user cache the homepage for 15 seconds: 200 OK If I'm building a page on the fly, there is no date associated with it - it's now. Not everything on the server has a date associated with it. Your browser did have to suffer the round-trip delay of sending a request to the server, and waiting for the response, but it did save having to re-download the static content. Rather than sending the client 200 OK, followed by the contents of the page, it instead tells you that your cached version is good: 304 Not Modified The server receives the request, realizes that the client has the most recent version already. It will ask the server for the file, but instruct the server to only send the file if it has been modified since 6 3:13:38: GET / HTTP/1.1 they forgot to include E-Tag (so the browser can do a conditional request)īut they did include a Last-Modified date in the response: Last-Modified: Tue, 03:13:38 GMTīecause the browser knows the date the file was modified, it can perform a conditional request.they forgot to include Max-Age (so the browser knows how long the cached item is good for).they forgot to include Expires (so the browser knows to use the cached copy until that date).only on your own local machine):īut the server forgot to include any sort of caching hints: the item should only be cached in a private cache, i.e. The server kindly asked any intermediate proxies to not cache the contents (i.e. To answer your question about why caching is working, even though the web-server didn't include the headers: