# Astro, set caching headers

> A quick reference for setting caching headers in Astro, using Astro.response.headers.set to send a Cache-Control header like public, max-age=3600.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2024-09-14 | Topics: [Astro](https://flaviocopes.com/tags/astro/) | Canonical: https://flaviocopes.com/astro-set-caching-headers/

Writing this down for reference

```javascript
Astro.response.headers.set('Cache-Control', 'public, max-age=3600')
```

If you need a different caching policy, I built a free [Cache-Control header builder](https://flaviocopes.com/tools/cache-control/) that puts together the right directives for you.
