Back to articles

How does the Fasterize cache work?

Caching is an essential technique for improving website performance by significantly reducing loading times.

Summary

Introduction

Caching is an essential technique for improving website performance by significantly reducing loading times.

However, implementation becomes more complex when dealing with dynamic pages containing personalized elements embedded directly in the HTML code. These may include the user's name, product recommendations, geolocated content, personalized prices, or information related to the session or browsing history.

These variations make each page potentially unique, which complicates caching. The challenge is therefore to identify and isolate these variable areas in order to optimize and cache the rest of the content, which is common to all users.

At Fasterize, we have developed several advanced methods over the years to address these issues.

This article guides you through the various cache solutions we offer.

Two complementary layers of cache

Fasterize relies on two complementary cache layers to ensure maximum performance:

  1. A CDN cache, which, in its default configuration, is designed to cache all static resources (images, CSS, JS, fonts, etc.) and serve them as close as possible to the end user via the network, with the option of also managing HTML cache.
  2. A Fasterize engine cache, integrated into the core of the platform, which manages the HTML cache (static or dynamic pages) as well as static resources.

Why two layers?

In summary: the CDN ensures fast delivery, while the Fasterize engine applies HTML optimization and caching intelligence.

Static resource cache

Caching static files is an essential practice. It applies to resources such as CSS files, JavaScript, images, fonts, etc.

The Fasterize engine respects the HTTP header. Cache Control defined by your origin server. If it is missing or incorrect, you can replace it from the console by configuring the TTL.

The engine allows for fine-grained configuration by defining whether the resource should be cached on the browser side, in a CDN, or both.

Where do I configure this in the console?

Console > Configuration > Resource Cache

Resource cache capture

Good to know: If you opt for CDN caching, static resources can be served directly from the CDN, further optimizing response times.

Option: URL Versioning in the Assets tab

Versioning static resources is a key technique for ensuring good cache management over the long term.

In particular, it helps avoid problems related to obsolete files (such as outdated CSS), but it can also reduce the cache hit rate by multiplying unique URLs.

If you already use effective versioning, there is no need to enable this option on the Fasterize side.

Principle: A version parameter is added to the file URL (e.g., style.css?v=12345).

When a cache purge is performed on Fasterize, a new version of the URL is automatically generated, forcing all intermediate caches (CDN, browser, proxy, etc.) to update.

Advantage: no need to manually manage long expirations or force browsers to reload files: changing the URL is enough to invalidate the old cache.

Caching HTML pages (static & dynamic)

Fasterize allows you to cache HTML pages, whether they are non-personalized (static) or partially personalized (dynamic).

The goal is to maximize the reuse of optimized HTML while respecting variations related to the user context.

1. Cache static HTML pages

Some HTML pages are identical for all users (FAQ, legal notices, terms of use, etc.). They can therefore be fully cached.

Where do I configure this in the console?

Console > Configuration > Page cache

Static page cache

HTML cache segmentation

To ensure that each user receives a version of the page that is adapted to their browsing context (device, bot, etc.), Fasterize applies automatic HTML cache classification.

This mechanism defines the number of variants cached for the same URL. You can choose between three modes:

1. Responsive Mode

Ideal if your site is responsive and the HTML is identical regardless of the device.

2. Adaptive Mode

Recommended if your site delivers different HTML depending on the device.

3. Adaptive Mode – Bot First

Useful if you deliver specific HTML to crawlers.

Where do I configure this in the console?

Console > Configuration > Page Cache > Cache Variation tab

Cache variation

Caching dynamic HTML pages

Some HTML pages contain personalized elements (user account, recommendations, welcome message, dynamic pricing, etc.). Although they are partially dynamic, their content is often mostly common among users.

Two observations based on our experience:

  1. Dynamic pages are often only partially dynamic: only a portion of the HTML changes.
  2. Dynamic pages are not always dynamic: for example, a product page remains unchanged until a user logs in.

Based on this, we have developed three complementary strategies for dynamic pages.

a. SmartCache

SmartCache allows any HTML page to be cached, even partially customized ones.

Principle: the page is divided between:

Rendering in two stages:

  1. The browser loads the HTML structure from the cache.
  2. Dynamic blocks are loaded asynchronously via Ajax.

Auto refresh

When a user triggers an Ajax SmartCache request:

  1. Fasterize intercepts the request.
  2. Request the original dynamic data.
  3. Sends the response to the browser.
  4. And refreshes the fragment cache.

Where can I configure SmartCache?

Console > Configuration > Page cache

Add a SmartCache fragment via a CSS selector.

b. The Cookie-Less Cache

Principle: display a cached page as long as the user does not have any cookies (anonymous visitor).

This cache allows you to respond quickly without unnecessarily soliciting the source.

Advantage: No configuration required: it activates automatically.

Where to configure?

Console > Configuration > Page Cache > Cache Variation tab

Anonymous caching

Check: “Anonymous page caching”

c. The Dynamic Cache

Principle: Fasterize temporarily stores an optimized version of the dynamic HTML page for 1 minute. If another identical request arrives within that time frame, it is served without reprocessing.

Benefits:

Where do I configure this in the console?

Console > Configuration > HTML > Dynamic Cache tab

Which type of cache should be enabled?

The choice of method depends on the type of page and its level of customization.

Here is our recommended order of priority for intelligently activating the various cache strategies:

  1. Classic cacheForcompletely static pages and resources.
  2. Smart CacheForpages containing identifiable dynamic areas.
  3. Cookie Less CacheFordynamic pages displayed to anonymous visitors (without cookies).
  4. Dynamic Cache isautomatically activatedif none of the previous three are applicable.

This approach ensures excellent cache coverage while maintaining effective personalization for your users.