@prismicio/next
Version:
Helpers to integrate Prismic into Next.js apps
22 lines (21 loc) • 771 B
JavaScript
import { getPrismicCacheTags } from "./getPrismicCacheTags.js";
import { cacheTag } from "next/cache.js";
//#region src/cacheTagPrismicPages.ts
/**
* Tags the current cache entry with cache tags for a set of Prismic pages so they can be
* revalidated when their content changes.
*
* Linked documents (via content relationships) are tagged as well, so the cache entry is
* revalidated when any of its nested documents change.
*
* @param pages - A set of Prismic pages used to tag the cache entry.
* @experimental
*
* @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}
*/
function cacheTagPrismicPages(pages) {
cacheTag(...getPrismicCacheTags(pages));
}
//#endregion
export { cacheTagPrismicPages };
//# sourceMappingURL=cacheTagPrismicPages.js.map