![]() ![]() For example, some CDNs compress images to reduce bandwidth. max, which will expire when the universe ends, on the 31 of December, 2037Īdditionally, you can add the no-transform directive, which disables any conversions that may be done to the resource.epoch, set to Unix time zero, which will explicitly turn off caching and purge all caches (useful if you’re using NGINX as a reverse proxy).The resource, if unexpired, is unchanged on the server and. -1, or off, which will turn off caching, and not modify existing headers immutable: Indicates that the response body will not change over time.However, NGINX allows for a few more custom values: When setting the max-age, it’s always done in seconds. The public response directive indicates that a resource can be cached by any cache. Use this only for highly sensitive data that shouldn’t be sent twice. Use this if you want the user to revalidate each time The public response directive indicates that a resource can be cached by any cache. This setting is usually used for sensitive data, such as personal banking details. config but, this sets the cache-control header to private, public, expires74464 which still prevents proxies from caching. The browser may still cache the response for performance but must check with the origin server for updates before using it. The no-store directive means browsers aren’t allowed to cache a response and must pull it from the server each time it’s requested. The last important directives we haven’t discussed yet are a little bit different, as they control which types of caches are allowed to cache the resources. 'must- revalidate', 'proxy-revalidate', 'public' or 'private' cache-control directive (section 14.9). no-cache – Despite the name, it doesn’t disable caching. Certain cache-control directives are therefore provided so that the server can indicate that certain resource entities, or portions thereof, are not to be cached regardless of other considerations.private– Contains sensitive data that cannot be cached by CDNs or reverse proxies.public– May be cached by anyone, including browsers and CDNs.
0 Comments
Leave a Reply. |