Add reusable-content cache tag.

This commit is contained in:
Steven Hall
2025-05-01 10:03:26 +01:00
parent 5a69692f54
commit fb97b76787
2 changed files with 16 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@gitbook/cache-tags": minor
---
Add reusable content cache tag.
+11
View File
@@ -35,6 +35,14 @@ export function getCacheTag(
space: string;
changeRequest: string;
}
/**
* All data related to resuable content.
*/
| {
tag: 'reusable-content';
space: string;
reusableContent: string;
}
/**
* Immutable data related to a revision
* @deprecated - in v2, no tag as this is an immutable data
@@ -108,6 +116,8 @@ export function getCacheTag(
return `space:${spec.space}:document:${spec.document}`;
case 'computed-document':
return `space:${spec.space}:computed-document:${spec.sourceType}`;
case 'reusable-content':
return `space:${spec.space}:reusable-content:${spec.reusableContent}`;
case 'site':
return `site:${spec.site}`;
case 'integration':
@@ -116,6 +126,7 @@ export function getCacheTag(
return `organization:${spec.organization}:openapi:${spec.openAPISpec}`;
case 'translation':
return `organization:${spec.organization}:translation:${spec.translationSettings}`;
default:
assertNever(spec);
}