Back to articles

How can I optimize caching of static resources?

To improve your website's performance, caching static resources (images, CSS files, JavaScript, etc.) is essential. Fasterize's Resource Cache application allows you to precisely define how and where these files are cached: browser, CDN, and platform. In this article, we explain how this application works, how to effectively configure your cache policies, and what the impacts are on web performance.

Introduction

To improve your website's performance, caching static resources (images, CSS files, JavaScript, etc.) is essential. Fasterize's Resource Cache application allows you to precisely define how and where these files are cached: browser, CDN, and platform.

In this article, we explain how this application works, how to effectively configure your cache policies, and what the impacts are on web performance.

Understanding TTL (Time To Live)

By default, static resources are cached for 1 month.

This duration is defined by the TTL (Time To Live), i.e. the lifetime of the object in the cache on the different layers:

You can adjust this duration according to your needs in the configuration interface.

Configure cache policies

By enabling caching of static objects and images, you serve files from a peripheral cache, thereby reducing the load on your server.

💡 To go further: Learn more about a smart cache system

Enable URL versioning for more durable caches

The Fasterize engine enables a best practice in web performance: versioning of static files.

In concrete terms:

💡 This value is automatically updated after each cache purge.

Advanced settings

To further control the cache, several advanced options are available.

Prevent CDN Cache

Enable this option to disable CDN caching during discovery or A/B testing phases. This prevents performance measurements from being skewed by cached data.

Correction of ambiguous cache control

In some cases, the origin may send incorrect or ambiguous cache-control headers.

This option automatically corrects these headers to prevent resources from being cached that should not be cached.

A real web performance gain

💡 By serving resources from the browser or a CDN, you: