CDN caching accelerates the loading times of images as it allows to host them as close as possible to your end users. By using CDN caching, your ensure maximum performance of your website.
You can define the
s-maxage attributes in the Cache-Control HTTP Header of media assets delivered by Filerobot to control the caching behaviour.
When the cache interval expires, the media asset will be considered as stale and the CDN will request it again from the origin. Reduce the default values if you have rotating images but static image URLs without versioning.
In the interest of better performance, we recommend to use at least 7 days (604800 seconds) for
s-maxage . This would keep your cache-hit ratio high and avoid too frequent re-downloads of the media asset from the Filerobot store by the CDN PoP.
||The time in seconds that the image is allowed to be re-used.
||This directive applies only to the caching in CDN. To maximise performance,
we recommend you set a high value here and invalidate images when needed.
You can access the caching settings by navigating to Accelerate settings / Caching.
In case specific media assets are meant to change frequently and versioning of your URLs is not possible, it is possible to override the default cahcing interval using the
This will override the
s-maxage attributes for this asset only to 7200 seconds.
If a media asset needs to be refreshed in the cache and you do not want to wait until the cache interval expires, then you can trigger an invalidation on the Filerobot CDN to refresh the media asset. The Invalidation API is available for various types of invalidation.