Back to Vercel

Interface: PurgeApi

packages/functions/docs/interfaces/index.PurgeApi.md

16.1.26.1 KB
Original Source

Interface: PurgeApi

index.PurgeApi

Vercel Cache Purge APIs.

Table of contents

Properties

Properties

dangerouslyDeleteBySrcImage

dangerouslyDeleteBySrcImage: (src: string | string[], options?: DangerouslyDeleteOptions) => Promise<void>

Type declaration

▸ (src, options?): Promise<void>

Given a source image, delete all of its transformed images after a specified revalidation deadline. If accessed prior to the revalidation deadline, the stale transformed image will be served and a background task will be triggered. After the revalidation deadline is reached, the transformed image will be deleted. The default revalidation deadline is 0 and the content will be deleted immediately.

Parameters
NameTypeDescription
srcstring | string[]The source image to delete.
options?DangerouslyDeleteOptionsThe options for the delete that specify the revalidation deadline.
Returns

Promise<void>

A promise that resolves when the delete is complete.

Defined in

packages/functions/src/purge/types.ts:54


dangerouslyDeleteByTag

dangerouslyDeleteByTag: (tag: string | string[], options?: DangerouslyDeleteOptions) => Promise<void>

Type declaration

▸ (tag, options?): Promise<void>

Delete all content associated with a tag or tags after a specified revalidation deadline. If accessed prior to the revalidation deadline, the stale content will be served and a background revalidation will be triggered. After the revalidation deadline is reached, the content will be deleted. The default revalidation deadline is 0 and the content will be deleted immediately.

Parameters
NameTypeDescription
tagstring | string[]The tag or tags to delete.
options?DangerouslyDeleteOptionsThe options for the delete that specify the revalidation deadline.
Returns

Promise<void>

A promise that resolves when the delete is complete.

Defined in

packages/functions/src/purge/types.ts:31


invalidateBySrcImage

invalidateBySrcImage: (src: string | string[]) => Promise<void>

Type declaration

▸ (src): Promise<void>

Given a source image, invalidate all of its transformed images by marking them as stale. On the next access, the stale transformed image will be served and a background task will transform the source image.

Parameters
NameTypeDescription
srcstring | string[]The source image to invalidate.
Returns

Promise<void>

A promise that resolves when the invalidate is complete.

Defined in

packages/functions/src/purge/types.ts:43


invalidateByTag

invalidateByTag: (tag: string | string[]) => Promise<void>

Type declaration

▸ (tag): Promise<void>

Invalidate all content associated with a tag or tags by marking them as stale. On the next access to content associated with any of the tags, the stale content will be served and a background revalidation will be triggered.

Parameters
NameTypeDescription
tagstring | string[]The tag or tags to invalidate.
Returns

Promise<void>

A promise that resolves when the invalidate is complete.

Defined in

packages/functions/src/purge/types.ts:20