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.
The path (relative to the bucket) of the object to purge, e.g. `folder/avatar.png`.
Optional purge cache options.
Optional fetch parameters such as an `AbortController` signal.
const { data, error } = await supabase
.storage
.from('avatars')
.purgeCache('folder/avatar1.png')
const { data, error } = await supabase
.storage
.from('avatars')
.purgeCache('folder/avatar1.png', { transformations: true })