5/6/2023 0 Comments Private cache vs shared cache![]() ![]() This is typically done using an ETag.Īn ETag is another HTTP header which contains a token unique to the version of the resource at the time it was requested. This directive means that cached versions of the requested resource cannot be used without first checking to see if there is an updated version. This directive is typically reserved for resources that contain extremely sensitive data, such as bank account information. This means that every time a user requests this data, a request must be sent to the origin server for a fresh copy. cache-control: no-storeĪ response with a ‘no-store’ directive cannot be cached anywhere, ever. cache-control: publicĬonversely, the ‘public’ directive means the resource can be stored by any cache. These are often resources containing private data, such as a website displaying a user’s personal information. Below we go through some of the most common cache-control directives: cache-control: privateĪ response with a ‘private’ directive can only be cached by the client and never by an intermediary agent, such as a CDN or a proxy. These values are called directives, and they dictate who can cache a resource as well as how long those resources can be cached before they must be updated. The ‘value’ is what’s found on the right of the colon, and there can be one or several comma-separated values for cache control. For cache-control, the ‘key’, or the part to the left of the colon, is always ‘cache-control’. Headers consist of key-value pairs which are separated by a colon.
0 Comments
Leave a Reply. |