Contents
What is Max-age in cache-control header?
Cache-control: max-age It is the maximum amount of time specified in the number of seconds. For example, max-age=90 means that a HTTP response remains in the browser as a cached copy for the next 90 seconds before it can be available for reuse.
What is s max-age?
max-age= The maximum amount of time a resource is considered fresh. Unlike Expires , this directive is relative to the time of the request. s-maxage= Overrides max-age or the Expires header, but only for shared caches (e.g., proxies).
How long does CloudFlare cache take?
CloudFlare offers a range of edge cache expire TTLs based on plan type: Free 2 hours. Pro 1 hour. Business 30 minutes.
How long does Cloudflare cache 404?
Understand Cloudflare’s default cache behavior
| 200, 206, 301 | 120m; |
|---|---|
| 302, 303 | 20m; |
| 404, 410 | 3m; |
What’s the max age for the Cache Control header?
Other user agents will of course vary, so…try and choose a number that is unlikely (rather than likely!) to cause an overflow. Max-age greater than 31536000 (one year) makes little sense, and informally this is considered a reasonable maximum value.
When to use s-maxage and Max-age headers?
1 Answer 1. The s-maxage header is intended for proxies, while max-age is intended for regular users. A typical end user (not using a proxy) would have the file cached for a year. The same should be the case for someone using a proxy as well, since the proxy will likely send the file unmodified, i.e. including the max-age header.
When to use the max-age directive in HTML?
The max-age directive is used to specify (in seconds) the maximum age of the content before it becomes stale (i.e., the content will not change for some period of time). So if you know that your content will not change for 3 days, you want your server to add the following HTTP header: Cache-Control: max-age=259200.
What does the Cache-Control header in http mean?
The Cache-Control HTTP header holds directives (instructions) for caching in both requests and responses. A given directive in a request does not mean the same directive should be in the response. Caching directives have the following rules to be valid: Case-insensitive, but lowercase is recommended.