Home

The immutable directive guarantees the response bodywill not change during the freshness lifetime. If the origin is unreachable, thecache returns a 504 instead of serving stalecontent. No-cacheis efficient for frequently updated content.no-store is for content that must never persiston disk. The timerstarts from the moment the origin creates the response,so transit time and time spent in intermediate cachescount against the budget. The no-transform directive forbids intermediariesfrom modifying the response body, such as recompressingimages or converting media formats.

To prevent a cache from storing a response atall, use no-store instead. Multiple directives are separated by commas in asingle header value or split across multipleCache-Control headers. Browser and CDN caching behavior is controlledthrough the Cache-Control header. If you consider nocache cat , in most (all?) cases the cache will not be restored. The server can respond with a 304 Not Modified status code, indicating that the content hasn’t changed, and the cache can continue using the cached copy. However, both public and private caches may use their own heuristics to determine caching behavior.

  • The min-fresh directive requests a stored responsewhose remaining freshness lifetime is at least thespecified number of seconds.
  • You can use the public directive to unlock that restriction.
  • This usually means the response can be reused for subsequent requests, depending on request directives.
  • If no cached response is available, a 504 Gateway Timeout response will be returned.
  • If the response becomes stale, it must be validated with the origin server before reuse.

Resources

Note that no-cache means “it can be stored but don’t reuse before validating” — so it’s not for preventing a response from being stored. Clients can use this header when the user requires the response to not only be fresh, but also requires that it won’t be updated for a period of time. Browsers usually add no-cache to requests when users are force reloading a 4rbet page. No-cache allows clients to request the most up-to-date response even if the cache has a fresh response.

If the response becomes stale, it must be validated with the origin server before reuse. If the sense of “don’t cache” that you want is actually “don’t store”, then no-store is the directive to use. It is a criterion for whether a response is fresh or stale. Store a response in caches when the response is cacheable. It can store and reuse personalized content for a single user.

Also useful for real-time data that needs to always be fresh, like stock prices or live sports scores. It is suitable for sensitive data or regularly changing data that you don’t want to be cached. You can also enable the “Cache Control” column to view cache settings for all resources.

Table of Contents

If you have to use an older version of Chrome, you may be able to get a compatible extension from Tampermonkey.net. The version in the store works with recent versions of Chrome (v22 or newer, which are based on the Blink rendering engine). Rel.crx is the Chrome extension, rel.pem the key to create another Tampermonkey extension file with the same extension ID This repository contains the source of the Tampermonkey extension up to version 2.9.All newer versions are distributed under a proprietary license. Speed up your downloads with Aria2, manage your download tasks easily.

The private response directive indicates that the response can be stored only in a private cache (e.g., local caches in browsers). The no-store response directive indicates that any caches of any kind (private or shared) should not store this response. The proxy-revalidate response directive is the equivalent of must-revalidate, but specifically for shared caches only. If you want caches to always check for content updates while reusing stored content, no-cache is the directive to use. Indicates that caches can store this response and reuse it for subsequent requests while it’s fresh. It stores a single response and reuses it with multiple users — so developers should avoid storing personalized contents to be cached in the shared cache.

Userscripts are small JavaScript programs that can be used to add new features or modify existing ones on web pages. Tampermonkey is one of the most popular browser extensions across all major browsers.It’s available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.

Automatic Script Update

When a user reloads the browser, the browser will send conditional requests for validating to the origin server. The immutable response directive indicates that the response will not be updated while it’s fresh. No-transform indicates that any intermediary (regardless of whether it implements a cache) shouldn’t transform the response contents. If a cache supports must-understand, it stores the response with an understanding of cache requirements based on its status code. Note that s-maxage or must-revalidate also unlock that restriction. In general, when pages are under Basic Auth or Digest Auth, the browser sends requests with the Authorization header.