Caching objects in a public bucket
When a user requests an object in a public bucket for the first time, the object is saved in the S3 cache. If an object is cached, upon a subsequent request, the user will receive it immediately from the storage cache server instead of from its backend server.
The cache is cleared automatically when an object body is changed; the caching system tracks changes using an MD5 hash.
You can change the caching settings for a bucket using the Cache-Control header — for example, limit the cache lifetime or not store it.
To get the up-to-date version of an object, you can clear the cache manually—this will update the content on the cache server.
Clear cache
- In the control panel, in the top menu, click Products and select S3.
- Go to the Purge cache section.
- Paste the links to each object for which you want to clear the cache.
- Click Purge cache.
Configure caching
- In the control panel, in the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Configuration tab.
- In the Cache-Control field, enter caching settings separated by commas — for example,
public, no-cache, private, max-age=31536000, where31536000is the maximum cache storage time in seconds. - Click Save.