Skip to navigationSkip to main contentSkip to footerScaleway Docs HomepageAsk our AI
Ask our AI

How to configure an Edge Services cache

The cache feature lets Edge Services store and serve your backend's content to users directly from its own servers, not from your backend, enhancing performance.

You can disable and enable caching at will, as well as control the lifetime of an object in the cache. You can also purge your entire cache, or specific objects within it. A log is displayed to help you track your purge events.

Before you start

To complete the actions presented below, you must have:

How to enable the cache

  1. Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.

  2. Click the name of the pipeline you want to enable cache for, then open the Settings tab.

  3. In the Cache panel, click Enable cache. A configuration pop-up displays.

  4. Configure the Lifetime of the cached objects to define how long they can be stored in the cache before they must be retrieved freshly from the pipeline backend.

    Tip

    A value of 0 means that objects will not be cached, unless you define a caching directive separately. Note that in any case, if an object has a caching directive, the caching directive always takes precedence over any lifetime setting defined here in Edge Services.

  5. Click Save to proceed.

The cache is now enabled.

How to purge all objects from your cache

Purging objects clears all objects from your cache. Afterward, Edge Services will retrieve fresh copies from the backend before it stores them again in the cache.

  1. Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.

  2. Click the name of the pipeline you want to enable cache for, then open the Settings tab.

  3. In the Purge cache panel, click Purge all.

    A pop-up displays, warning you that your cache will be emptied, and Edge Services will have to retrieve objects from your backend before re-caching them.

  4. Click Purge cache to confirm.

    All objects are purged from your cache.

How to purge specific objects from your cache

This allows you to specify the precise objects that you want to clear from the cache. Afterward, Edge Services will retrieve fresh copies from the backend before it stores them again in the cache.

  1. Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.

  2. Click the name of the pipeline you want to enable cache for, then open the Settings tab.

  3. In the Purge cache panel, click Purge by object.

    A pop-up displays prompting you to enter the path of each object you want to purge from the cache.

  4. Enter the path of each object you want to purge. You can purge a maximum of 5 objects at a time.

    Tip

    The path for each object should be defined from the root and must start with a slash, e.g. /videos/my-video.mp4.

    You cannot purge entire directories by simply specifying the path to the directory, e.g. /videos. Purging objects must be done strictly object-by-object, so /videos/my-video1.mp4, /videos/my-video2.mp4, /videos/my-video3.mp4 etc. Watch this space for updates to this feature in the future.

    For example, if we imagine an Object Storage bucket containing one file at the root level called object1.jpg, and a subfolder at root level called videos containing an item called my-video.mp4, we would enter the object paths as follows:

    • /object1.jpg
    • /videos/my-video.mp4
  5. Click Purge objects from cache.

    The specified objects are purged from your cache.

How to use Cache-Control

To avoid repeated purging, you can also set the Cache-Control HTTP header directly on your files/objects. This allows you to define how long items should remain in the cache before being freshly retrieved from the backend. Edge Services will respect this header when determining where to fetch content.

For Object Storage bucket backends, the following example call to the S3 API updates the Cache-Control header for all objects in the bucket, setting a maximum age of 60 seconds before they must be freshly retrieved.

./s3cmd --recursive modify --add-header="Cache-Control:max-age=60" s3://yourbucket/

How to disable your cache

  1. Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.

  2. Click the name of the pipeline you want to enable cache for, then open the Settings tab.

  3. In the Cache panel, click Disable cache.

    A pop-up displays, asking you to confirm the action.

  4. Click Disable cache.

    Your cache is purged and disabled. Edge Services will now serve content by fetching it from your pipeline backend directly. If you re-enable your cache later, it will start empty.

Troubleshooting cache problems

See our dedicated documentation on resolving unexpected caching behavior with Edge Services.

No Results