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:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- An Edge Services pipeline
How to enable the cache
-
Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.
-
Click the name of the pipeline you want to enable cache for, then open the Settings tab.
-
In the Cache panel, click Enable cache. A configuration pop-up displays.
-
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.
-
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.
-
Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.
-
Click the name of the pipeline you want to enable cache for, then open the Settings tab.
-
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.
-
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.
-
Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.
-
Click the name of the pipeline you want to enable cache for, then open the Settings tab.
-
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.
-
Enter the path of each object you want to purge. You can purge a maximum of 5 objects at a time.
-
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
-
Click Edge Services in the Network section of the Scaleway console side menu. A listing of your pipelines displays.
-
Click the name of the pipeline you want to enable cache for, then open the Settings tab.
-
In the Cache panel, click Disable cache.
A pop-up displays, asking you to confirm the action.
-
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.