Skip to content

Commit 6cce771

Browse files
committed
add comment
1 parent f6b51a9 commit 6cce771

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mdx.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ export async function getFileBySlug(slug: string): Promise<SlugFile> {
531531
const outdir = path.join(root, 'public', 'mdx-images');
532532
await mkdir(outdir, {recursive: true});
533533

534+
// If the file contains content that depends on the Release Registry (such as an SDK's latest version), avoid using the cache for that file, i.e. always rebuild it.
535+
// This is because the content from the registry might have changed since the last time the file was cached.
536+
// If a new component that injects content from the registry is introduced, it should be added to the patterns below.
534537
const skipCache =
535538
source.includes('@inject') ||
536539
source.includes('<PlatformSDKPackage') ||
@@ -539,7 +542,9 @@ export async function getFileBySlug(slug: string): Promise<SlugFile> {
539542
if (process.env.CI) {
540543
if (skipCache) {
541544
// eslint-disable-next-line no-console
542-
console.info(`Skipping cache for ${sourcePath}`);
545+
console.info(
546+
`Not using cache for ${sourcePath}, as its content depends on the Release Registry`
547+
);
543548
} else {
544549
cacheKey = md5(source);
545550
cacheFile = path.join(CACHE_DIR, `${cacheKey}.br`);

0 commit comments

Comments
 (0)