From 345cf758efd733facaa0ecb48a89960f7656cc7d Mon Sep 17 00:00:00 2001 From: David Merfield Date: Fri, 22 Nov 2024 12:00:13 +0100 Subject: [PATCH] Updates CDN url helper --- app/documentation/tools/cdn-url-helper.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/documentation/tools/cdn-url-helper.js b/app/documentation/tools/cdn-url-helper.js index e99eee8d2fc..b2bc987510f 100644 --- a/app/documentation/tools/cdn-url-helper.js +++ b/app/documentation/tools/cdn-url-helper.js @@ -9,8 +9,9 @@ const cache = {}; module.exports = ({ cacheID, viewDirectory }) => { return () => (text, render) => { const path = render(text); + const cacheKey = `${cacheID}-${path}`; - let identifier = cache[cacheID]; // Check if the result is already cached + let identifier = cache[cacheKey]; // Check if the result is already cached if (!identifier) { try { @@ -19,7 +20,7 @@ module.exports = ({ cacheID, viewDirectory }) => { // console.log('hashed', path, identifier); // Cache the result for future use - cache[cacheID] = identifier; + cache[cacheKey] = identifier; } catch (e) { console.log("failed to hash", path, e); // if the file doesn't exist, we'll use the cacheID