# Cache Management


The current iteration of the CDN service does not provide a simple way to manually clear the CDN cache. By default, each asset accessed through a VPN endpoint will be cached with a TTL (Time-To-Live) of 7 days when it is first accessed. The TTL can customize by setting the `expires` or `cache-control` headers of the source SOS object.

At 90% of the TTL, the object will be re-downloaded and the CDN cache will be updated with the new version if the object has been modified.

If you need more control over your CDN cache, you have two possible strategies you can use:

- Use versioning in your file naming scheme
- Use a short TTL

## Versioning

If you use a version naming scheme, you can serve different versions of your content while ensuring you can show your user new content before the cache expires.

There are 3 different strategies that you can use for a version naming scheme:

- Use a query string: `myfile.txt?v=101`
- Add the version in the filename: `myfile.v101.txt`
- Use a folder naming tree: `/v101/myfile.txt`


## Cache Control 

You can set `expires` or `cache-control` on individual objects to indicate to the CDN provider that you want to use a different TTL other than the 7-day default.

`Cache-Control` can for example be used to set a 72-hour TTL:


        Cache-Control: public, max-age=259200


Or you can use `Expires` to set the set date at which the content should be considered stale.


        Expires: Wed, 21 Oct 2023 07:28:00 GMT


You can read more about HTTP headers on the MDN documentation:

- [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
- [Expires](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires)
