14 Matching Annotations
- Sep 2023
- Aug 2023
-
datatracker.ietf.org datatracker.ietf.org
Tags
- http:header=cdn-cache-control
- http
- caching
- urn:ietf:rfc:9213
- http:header=cdn-cache-control:must-revalidate
- wikipedia:en=HTTP_caching
- http:header=cdn-cache-control:no-store
- http:header=cdn-cache-control:max-age
- http:header=cdn-cache-control:no-cache
- http:header=cdn-cache-control:private
- cdn
Annotators
URL
-
-
datatracker.ietf.org datatracker.ietf.org
Tags
- http:header=if-range
- http:header=cache-control:no-store
- http:header=pragma
- http:header=if-unmodified-since
- http:header=cache-control:private
- caching
- http:header=cache-control:s-maxage
- http:header=if-none-match
- http:header=if-modified-since
- http:header=age
- http:header=cache-control:max-stale
- http:header=cache-control:no-transform
- http:header=cache-control:must-understand
- http:header=cache-control:proxy-revalidate
- http:header=cache-control:max-age
- http:header=if-match
- http:header=cache-control:no-cache
- http:header=cache-control:must-revalidate
- http:header=cache-control:min-fresh
- urn:ietf:rfc:9111
- http:header=expires
- http:header=cache-control:public
- http
- http:code=206
- wikipedia:en=HTTP_caching
- http:header=warning
- http:header=cache-control:only-if-cached
- http:header=cache-control
- http:code=304
Annotators
URL
-
- May 2023
-
github.com github.com
-
Figured it out. Cache-Control header is required.
js const headers = { 'Cache-Control': 'public, max-age=604800' }; const request = new Request('https://foobar.com/') const cacheResponse = new Response('bar',{ headers }) const cache = caches.default await cache.put(request, cacheResponse) const response = await cache.match(request);
-
- Mar 2023
-
simonhearne.com simonhearne.com
-
developers.cloudflare.com developers.cloudflare.com
-
<table><tbody><tr><th colspan="4" rowspan="1">Status</th><th colspan="4" rowspan="1">Description</th></tr><tr><td colspan="5" rowspan="1">HIT</td><td colspan="5" rowspan="1">The resource was found in Cloudflare’s cache.</td></tr><tr><td colspan="5" rowspan="1">MISS</td><td colspan="5" rowspan="1">The resource was not found in Cloudflare’s cache and was served from the origin web server.</td></tr><tr><td colspan="5" rowspan="1">NONE/UNKNOWN</td><td colspan="5" rowspan="1">Cloudflare generated a response that denotes the asset is not eligible for caching. This may have happened because:
- A Worker generated a response without sending any subrequests. In this case, the response did not come from cache, so the cache status will be
none/unknown
.- A Worker request made a subrequest (
fetch
). In this case, the subrequest will be logged with a cache status, while the main request will be logged withnone/unknown
status (the main request did not hit cache, since Workers sits in front of cache).- A Firewall rule was triggered to block a request. The response will come from the edge network before it hits cache. Since there is no cache status, Cloudflare will log as
none/unknown
.- A redirect page rule caused the edge network to respond with a redirect to another asset/URL. This redirect response happens before the request reaches cache, so the cache status is
</td></tr><tr><td colspan="5" rowspan="1">EXPIRED</td><td colspan="5" rowspan="1">The resource was found in Cloudflare’s cache but was expired and served from the origin web server.</td></tr><tr><td colspan="5" rowspan="1">STALE</td><td colspan="5" rowspan="1">The resource was served from Cloudflare’s cache but was expired. Cloudflare could not contact the origin to retrieve an updated resource.</td></tr><tr><td colspan="5" rowspan="1">BYPASS</td><td colspan="5" rowspan="1">The origin server instructed Cloudflare to bypass cache via a Cache-Control header set tonone/unknown
.no-cache
,private
, ormax-age=0
even though Cloudflare originally preferred to cache the asset. BYPASS is returned when enabling Origin Cache-Control. Cloudflare also sets BYPASS when your origin web server sends cookies in the response header.</td></tr><tr><td colspan="5" rowspan="1">REVALIDATED</td><td colspan="5" rowspan="1">The resource is served from Cloudflare’s cache but is stale. The resource was revalidated by either anIf-Modified-Since
header or anIf-None-Match header
.</td></tr><tr><td colspan="5" rowspan="1">UPDATING</td><td colspan="5" rowspan="1">The resource was served from Cloudflare’s cache and was expired, but the origin web server is updating the resource. UPDATING is typically only seen for very popular cached resources.</td></tr><tr><td colspan="5" rowspan="1">DYNAMIC</td><td colspan="5" rowspan="1">Cloudflare does not consider the asset eligible to cache and your Cloudflare settings do not explicitly instruct Cloudflare to cache the asset. Instead, the asset was requested from the origin web server. Use Page Rules to implement custom caching options.</td></tr></tbody></table> - A Worker generated a response without sending any subrequests. In this case, the response did not come from cache, so the cache status will be
-
-
Tags
Annotators
URL
-
-
developers.cloudflare.com developers.cloudflare.com
-
developer.mozilla.org developer.mozilla.org
- Feb 2023
- Jun 2017
-
developer.mozilla.org developer.mozilla.orgHTTP 缓存1
-
HTTP/1.1定义的 Cache-Control 头用来区分对缓存机制的支持情况, 请求头和响应头都支持这个属性。通过它提供的不同的值来定义缓存策略。
Request Header与Response Header都支持这个属性 通过调整Cache-Control头可以做出很多缓存策略:
- 完全不支持
- 不缓存内容
- 私有缓存
- 公共缓存
- 缓存过期时间
-