Caching objects in a public container
Caching objects in a public container
The first time a user requests an object in a public container, the object is stored in the object store's cache. If the object is cached, when the user makes a second request, the object will be retrieved immediately from the object store's cache server, not from its backend server.
The cache is cleared automatically when the object body changes, the caching system tracks changes by MD5 hash.
You can change the caching settings for a container via the Cache-Control
header.
To get the current 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, on the top menu, click Products and select Object Storage.
- Go to Clear Cache.
- Insert references to each object whose cache needs to be cleared.
- Click Clear cache.
Configure caching
- In the Control Panel, on the top menu, click Products and select Object Storage.
- Go to the Containers section.
- Open the container page → Configuration tab.
- In the Cache-Control field, enter the caching settings separated by commas — for example,
public, no-cache, private, max-age=31536000,
where31536000
is the maximum cache retention time in seconds. - Click Save.