Skip to main content

cache

Creates, updates, deletes, gets or lists a cache resource.

Overview

Namecache
TypeResource
Idvercel.edge_cache.cache

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
invalidate_by_tagsexecprojectIdOrName, tagsteamId, slugMarks a cache tag as stale, causing cache entries associated with that tag to be revalidated in the background on the next request.
delete_by_tagsexecprojectIdOrName, tagsteamId, slugMarks a cache tag as deleted, causing cache entries associated with that tag to be revalidated in the foreground on the next request. Use this method with caution because one tag can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. This method is for advanced use cases and is not recommended; prefer using invalidateByTag instead.
invalidate_by_src_imagesexecprojectIdOrName, srcImagesteamId, slugMarks a source image as stale, causing its corresponding transformed images to be revalidated in the background on the next request.
delete_by_src_imagesexecprojectIdOrName, srcImagesteamId, slugMarks a source image as deleted, causing cache entries associated with that source image to be revalidated in the foreground on the next request. Use this method with caution because one source image can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. This method is for advanced use cases and is not recommended; prefer using invalidateBySrcImage instead.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
projectIdOrNamestring
slugstringThe Team slug to perform the request on behalf of.
teamIdstringThe Team identifier to perform the request on behalf of.

Lifecycle Methods

EXEC variables use wire (API) names.

Marks a cache tag as stale, causing cache entries associated with that tag to be revalidated in the background on the next request.

EXEC vercel.edge_cache.cache.invalidate_by_tags
@projectIdOrName='{{ projectIdOrName }}' --required,
@teamId='{{ teamId }}',
@slug='{{ slug }}'
@@json=
'{
"tags": "{{ tags }}",
"target": "{{ target }}"
}'
;