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

Configure an Edge Services cache

The cache feature lets Edge Services store and serve your backend 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 available to help you track your purge events.

Before you start

To complete the following actions, you must have:

Enable the cache

  1. In the Scaleway console (External link) side menu, go to Network > Edge Services. A list of your pipelines appears.

  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 dialog box appears.

  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.

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. In the Scaleway console (External link) side menu, go to Network > Edge Services. A list of your pipelines appears.

  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 dialog box opens, 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.

Purge specific objects from your cache

You can 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. In the Scaleway console (External link) side menu, go to Network > Edge Services. A list of your pipelines appears.

  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 dialog box prompts 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, keeping in mind that:

    • You should define the path for each object from the root and the path must start with a slash (e.g., /videos/my-video.mp4).
    • You cannot purge entire directories by specifying the path to the directory (e.g., /videos). Purging objects must be done object-by-object (/videos/my-video1.mp4, /videos/my-video2.mp4, etc.).

    For example, if an Object Storage bucket contains a root-level file named object1.jpg and a subfolder videos containing my-video.mp4, the paths would be /object1.jpg and /videos/my-video.mp4.

    Tip

    You can purge a maximum of 5 objects at a time from the console, but you can use the Create a purge request API call (External link) to bypass this limitation.

  5. Click Purge objects from cache.

    The specified objects are purged from your cache.

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 S3 API call example updates the Cache-Control header of all objects in the bucket to a maximum age of 60 seconds. After this time, the cache must retrieve a fresh copy of each object.

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

Disable your cache

  1. In the Scaleway console (External link) side menu, go to Network > Edge Services. A list of your pipelines appears.

  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 confirmation dialog box appears.

  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 the troubleshooting documentation on resolving unexpected caching behavior with Edge Services.

Still need help?

Create a support ticket
No Results