# Leverage Browser Caching

> [!CAUTION]
> **Deprecated** . This page was written for version 4 of the PageSpeed Insights API, which is deprecated and will be shut down in May 2019. [Version 5](https://developers.google.com/speed/docs/insights/v5/get-started) is the latest and provides both real-world data from the Chrome User Experience Report and lab data from Lighthouse.


This rule triggers when PageSpeed Insights detects that the response from your server does not
include caching headers or if the resources are specified to be cached for only a short time.

### Overview


Fetching resources over the network is both slow and expensive: the download may require multiple
roundtrips between the client and server, which delays processing and may block rendering of page
content, and also incurs data costs for the visitor. All server responses should specify a caching
policy to help the client determine if and when it can reuse a previously fetched response.

### Recommendations


Each resource should specify an explicit caching policy that answers the following questions:
whether the resource can be cached and by whom, for how long, and if applicable, how it can be
efficiently revalidated when the caching policy expires. When the server returns a response it
must provide the `Cache-Control` and `ETag` headers:

- `Cache-Control` defines how, and for how long the individual response can be cached by the browser and other intermediate caches. To learn more, see [caching with Cache-Control](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#cache-control).
- `ETag` provides a revalidation token that is automatically sent by the browser to check if the resource has changed since the last time it was requested. To learn more, see [validating cached responses with ETags](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#validating-cached-responses-with-etags).


To determine the optimal caching policy for your site, please use the following guides:

- [Defining optimal Cache-Control policy](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#defining-optimal-cache-control-policy)
- [Invalidating and updating cached responses](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#invalidating-and-updating-cached-responses)
- [Caching checklist](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#caching-checklist)


We recommend a minimum cache time of one week and preferably up to one year for static assets, or
assets that change infrequently. If you need precise control over when resources are invalidated
we recommend using a URL fingerprinting or versioning technique - see invalidating and updating cached
responses link above.

## Feedback

Was this page helpful?
<button class="button button-primary expand-control gc-analytics-event" data-category="Helpful" data-value="1" data-label="/speed/docs/insights/LeverageBrowserCaching" style="background-color:#f44336;"> Yes </button>

> [!TIP]
> Great! Thank you for the feedback. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack
> Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss).

<button class="button button-primary expand-control gc-analytics-event" data-category="Helpful" data-value="0" data-label="/speed/docs/insights/LeverageBrowserCaching" style="position:absolute;top:0;left:70px;background-color:#f44336;"> No </button>

> [!WARNING]
> Sorry to hear that. If you have a specific, answerable question about using PageSpeed Insights, ask the question in English on [Stack
> Overflow](https://stackoverflow.com/questions/tagged/pagespeed-insights). For general questions, feedback, and discussion, start a thread in the [mailing list](https://groups.google.com/forum/#!forum/pagespeed-insights-discuss).