- Last Updated:
- [[2021-01-21]]
- Cache headers are parameters and values that are part of standard HTTP specification and determine if, when, and how resources may be saved locally by a client.
- `Pragma: no-cache`
- Pragma headers are for optional behavior, so this directive may be ignored. This shouldn't be used to enforce caching.
- `Cache-Control`
- "Cache-Control
Cache-Control headers were introduced in HTTP/1.1 to specify directives that must be followed by all caching implementations in the request/response chain. The common Cache-Control directives you will come across are:
public
private
no-cache
no-store
no-transform
must-revalidate
proxy-revalidate
max-age
s-maxage "
- `Expires`
- This header encourages a time-based caching model, where content is saved until they are considered "stale" (old). `Cache-Control` can still override these.
- `Last Modified`
- Takes a date and time as a value. This date indicates when the content being fetched was last updated.
- `ETag`
- Identifies the resource version with a unique tag. This allows the browser to request the resource if it does not have the latest version.
-