diff --git a/docs/02-app/01-building-your-application/10-deploying/index.mdx b/docs/02-app/01-building-your-application/10-deploying/index.mdx index 2f410be3cba22..ed1944aa9fca3 100644 --- a/docs/02-app/01-building-your-application/10-deploying/index.mdx +++ b/docs/02-app/01-building-your-application/10-deploying/index.mdx @@ -175,11 +175,13 @@ module.exports = class CacheHandler { }) } - async revalidateTag(tag) { + async revalidateTag(tags) { + // tags is either a string or an array of strings + tags = [tags].flat() // Iterate over all entries in the cache for (let [key, value] of cache) { // If the value's tags include the specified tag, delete this entry - if (value.tags.includes(tag)) { + if (value.tags.some((tag) => tags.include(tag))) { cache.delete(key) } } diff --git a/docs/02-app/02-api-reference/05-next-config-js/incrementalCacheHandlerPath.mdx b/docs/02-app/02-api-reference/05-next-config-js/incrementalCacheHandlerPath.mdx index d134f44024649..ce3fc4abd16cf 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/incrementalCacheHandlerPath.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/incrementalCacheHandlerPath.mdx @@ -39,9 +39,9 @@ Returns `Promise`. ### `revalidateTag()` -| Parameter | Type | Description | -| --------- | -------- | ---------------------------- | -| `tag` | `string` | The cache tag to revalidate. | +| Parameter | Type | Description | +| --------- | ---------------------- | ----------------------------- | +| `tag` | `string` or `string[]` | The cache tags to revalidate. | Returns `Promise`. Learn more about [revalidating data](/docs/app/building-your-application/data-fetching/caching-and-revalidating) or the [`revalidateTag()`](/docs/app/api-reference/functions/revalidateTag) function.