# Cache & compression

A step of the [Cloud application](https://gradus.kazet.blog/tree/cloud-application) tree on Gradus, in the Frontend area: Second app, UI, browser tests.

Page: https://gradus.kazet.blog/tree/cloud-application/step/cache-headers

Let browsers keep hashed assets for a year and always check the HTML, and compress what is sent.

Usually comes after: [Deploy the frontend](https://gradus.kazet.blog/tree/cloud-application/step/frontend-deploy).

## Prompt for your AI assistant

```
List the files the frontend serves and how each one is named. Send hashed assets with Cache-Control: public, max-age=31536000, immutable, version or config files the page polls with no-store and HTML with no-cache so a new release reaches everyone on the next load. Make sure a file without a hash in its name is never cached for long. Serve HTML, JavaScript, CSS, SVG and JSON compressed with Brotli or gzip. Add a post-deploy check that fetches one file of each kind with an Accept-Encoding header and compares its Cache-Control and Content-Encoding with what this step decided, and write the rules into docs/.
```

Every step of the tree: https://gradus.kazet.blog/tree/cloud-application/llms.txt
