purgeCache
Purges the CDN cache for a single object in this bucket.
Maps to DELETE /cdn/{bucket}/{path} on the Storage API. The server issues a CDN invalidation for the object and returns { message: 'success' }.
Requires the service_role key. The underlying endpoint enforces service_role JWT — calls made with the anon key or a user JWT will be rejected by the server.
Hosted CDN feature. On self-hosted Supabase, the Storage service must have CDN_PURGE_ENDPOINT_URL configured and the purgeCache tenant feature enabled, otherwise the server returns an error.
Operates on a single object path. There is no wildcard or recursion: pass the exact path of the object you want invalidated.
Parameters
The path (relative to the bucket) of the object to purge, e.g. folder/avatar.png.
Optional purge cache options.
Throws
or one of its subclasses if receiving an error response
if the request timed out
on network related issues