> For the complete documentation index, see [llms.txt](https://gzqsjtu.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gzqsjtu.gitbook.io/workspace/web-network-http/http-header.md).

# HTTP Header

Cache Header

{% embed url="<https://www.keycdn.com/blog/http-cache-headers>" %}

<https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers>

![](/files/-MEZfE9xCR2ysPIy1Ddn)

Caches work with content mainly through freshness and validation. A fresh representation is available instantly from a cache while a validated representation rarely sends the entire representation again if it hasn't changed. In cases where there is no validator present (e.g. `ETag` or `Last-Modified` header), and a lack of explicit freshness info, it will usually (but not always) be considered uncacheable. Let's shift our focus to the kind of headers you should be concerned about.

#### Extension `Cache-Control` directives[#](https://www.keycdn.com/blog/http-cache-headers#5-extension-cache-control-directives) <a href="#id-5-extension-cache-control-directives" id="id-5-extension-cache-control-directives"></a>

Apart from the well-known `Cache-Control` directives outlined in the first section of this article, there also exists other directives which can be used as extensions to `Cache-Control` resulting in a better user experience for your visitors.

```
Cache-Control: max-age=<seconds>
Cache-Control: max-stale[=<seconds>]
Cache-Control: min-fresh=<seconds>
Cache-control: no-cache 
Cache-control: no-store
Cache-control: no-transform
Cache-control: only-if-cached
```

**immutable#**

No conditional revalidation will be triggered even if the user explicitly refreshes a page. The immutable directive tells the client that the response body will not change over time, therefore, there is no need to check for updates as long as it is unexpired.

**stale-while-revalidate#**

The `stale-while-revalidate` directive allows for a stale asset to be served while it is revalidated in the background.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gzqsjtu.gitbook.io/workspace/web-network-http/http-header.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
