strapi-nextgen-framework
Version:
Production-ready, type-safe framework bridging Strapi v4 CMS and Next.js 14+ App Router with automatic cache management, Error Boundaries, and SEO optimization
34 lines • 1.19 kB
TypeScript
/**
* Cache tag generation utilities
* Generates consistent cache tags for Next.js revalidation
*/
/**
* Generates a cache tag for a Strapi resource
*
* @param type - Resource type (page, collection, global)
* @param identifier - Resource identifier (slug, collection name, global name)
* @param locale - Optional locale for i18n
* @returns Cache tag string
*
* @example
* ```typescript
* generateCacheTag('page', 'home') // 'strapi_page_home'
* generateCacheTag('page', 'about', 'fr') // 'strapi_page_about_fr'
* generateCacheTag('collection', 'blogPosts') // 'strapi_collection_blogPosts'
* generateCacheTag('global', 'header') // 'strapi_global_header'
* ```
*/
export declare function generateCacheTag(type: 'page' | 'collection' | 'global', identifier: string, locale?: string): string;
/**
* Parses a cache tag back into its components
* Useful for debugging and tag mapping
*
* @param tag - Cache tag string
* @returns Parsed tag components or null if invalid
*/
export declare function parseCacheTag(tag: string): {
type: 'page' | 'collection' | 'global';
identifier: string;
locale?: string;
} | null;
//# sourceMappingURL=cache-tags.d.ts.map