Vue Storefront is now Alokai! Learn More
CDN cache

CDN cache

From the Side Navigation, choose Caching layer -> CDN cache.

CDN works only for instances that don't use Basic Auth and are deployed to Alokai Console and Google Cloud Platform. If you don't have CDN enabled for your instance please follow the steps on how to enable it as described here.

Cache Invalidation

Normally when an object is cached, it remains alive until defined time expires (Time To Live). TTL is being controlled by HTTP headers. However, sometimes there is a necessity to remove the content from cache before it gets automatically expired and for this purpose, an invalidation process can be used.

Before the invalidation is executed, there should be a confirmation, that the origin server will respond with the proper content, otherwise when CDN will request for the objects again, it may receive and cache an incorrect data.

Every request for the invalidation is specified by path pattern that is related to the particular object or group of objects.

Alokai Console CDN Cache Invalidation.
To invalidate the CDN cache of Storerfont application, provide the invalidation path and click `Invalidate`.

The pattern may look like following:

  • /example.js - a specific file to be invalidated
  • /examples/* - a specific directory and all files within to be invalidated

A few path pattern rules to remember:

  • The path must start with /
  • No ? or # characters are allowed,
  • No * in the pattern, only at the end as the final character,
  • A path has to be base64 encoded,
  • Having two files, for example: /example.php?image=tree.js and /example.php?image=car.js, there is no option to invalidate only one of them. To do so, the entire path: /example.php must be set as an invalidation path pattern.

After clicking the Invalidate button, CDN Cache will invalidate cache for selected path and new content will be served accompanied with the notification in Alokai Console.

Learn more about CDN and SSR Cache here