From 2b8b5eb4731612535ce362307eabc35f567cc53c Mon Sep 17 00:00:00 2001 From: Nazar Leush Date: Fri, 14 Aug 2026 19:49:38 +0300 Subject: [PATCH 1/2] cache: send `refreshing` to cache if runs with `options.refresh` --- lib/plugins/system/htmlparser/htmlparser.js | 3 ++- lib/plugins/system/meta/meta.js | 3 ++- lib/plugins/system/oembed/oembedUtils.js | 3 ++- lib/request.js | 9 ++++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/plugins/system/htmlparser/htmlparser.js b/lib/plugins/system/htmlparser/htmlparser.js index 1c53a9883..e4ebfc192 100644 --- a/lib/plugins/system/htmlparser/htmlparser.js +++ b/lib/plugins/system/htmlparser/htmlparser.js @@ -105,7 +105,8 @@ export default { var key = metaUtils.getMetaCacheKey(url, whitelistRecord, options); cache.set(key, cachedData, { - ttl: ttl + ttl: ttl, + refreshing: options.refresh }); } diff --git a/lib/plugins/system/meta/meta.js b/lib/plugins/system/meta/meta.js index 4f73703af..a9924a958 100644 --- a/lib/plugins/system/meta/meta.js +++ b/lib/plugins/system/meta/meta.js @@ -50,7 +50,8 @@ export default { _sys_created_at: Math.floor(new Date().getTime() / 1000), _sys_headers: htmlparser.headers }, meta), { - ttl: ttl + ttl: ttl, + refreshing: options.refresh }); if (options.refresh) { diff --git a/lib/plugins/system/oembed/oembedUtils.js b/lib/plugins/system/oembed/oembedUtils.js index ab7ba055a..1653c3fbd 100644 --- a/lib/plugins/system/oembed/oembedUtils.js +++ b/lib/plugins/system/oembed/oembedUtils.js @@ -276,7 +276,8 @@ export function findOembedLinks(uri, meta) { cache.set(oembed_key, data, { // Use proxy.cache_ttl or options.cache_ttl. // If options.cache_ttl === 0 and no proxy.cache_ttl, then CONFIG.CACHE_TTL will be used. - ttl: utils.getMaxCacheTTL(uri, options) + ttl: utils.getMaxCacheTTL(uri, options), + refreshing: options.refresh }); } diff --git a/lib/request.js b/lib/request.js index 3ca318cb9..690e7675f 100644 --- a/lib/request.js +++ b/lib/request.js @@ -131,7 +131,8 @@ export default function(options, iframely_options, callback) { }, data: data }, { - ttl: ttl + ttl: ttl, + refreshing: refresh }); // temp cache migration, set new key as well @@ -143,7 +144,8 @@ export default function(options, iframely_options, callback) { }, data: data }, { - ttl: ttl + ttl: ttl, + refreshing: refresh }); } } @@ -207,7 +209,8 @@ export default function(options, iframely_options, callback) { if (new_cache_key) { cache.set('req:' + prefix + new_cache_key, data, { - ttl: ttl + ttl: ttl, + refreshing: refresh }); } From 65331a082e9cb2c8baef27d0ac9bd94621264a3a Mon Sep 17 00:00:00 2001 From: Nazar Leush Date: Mon, 17 Aug 2026 17:03:17 +0300 Subject: [PATCH 2/2] rename `refreshing` -> `refresh` --- lib/plugins/system/htmlparser/htmlparser.js | 2 +- lib/plugins/system/meta/meta.js | 2 +- lib/plugins/system/oembed/oembedUtils.js | 2 +- lib/request.js | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/plugins/system/htmlparser/htmlparser.js b/lib/plugins/system/htmlparser/htmlparser.js index e4ebfc192..991a780c7 100644 --- a/lib/plugins/system/htmlparser/htmlparser.js +++ b/lib/plugins/system/htmlparser/htmlparser.js @@ -106,7 +106,7 @@ export default { cache.set(key, cachedData, { ttl: ttl, - refreshing: options.refresh + refresh: options.refresh }); } diff --git a/lib/plugins/system/meta/meta.js b/lib/plugins/system/meta/meta.js index a9924a958..9ae6caaf6 100644 --- a/lib/plugins/system/meta/meta.js +++ b/lib/plugins/system/meta/meta.js @@ -51,7 +51,7 @@ export default { _sys_headers: htmlparser.headers }, meta), { ttl: ttl, - refreshing: options.refresh + refresh: options.refresh }); if (options.refresh) { diff --git a/lib/plugins/system/oembed/oembedUtils.js b/lib/plugins/system/oembed/oembedUtils.js index 1653c3fbd..82090d81f 100644 --- a/lib/plugins/system/oembed/oembedUtils.js +++ b/lib/plugins/system/oembed/oembedUtils.js @@ -277,7 +277,7 @@ export function findOembedLinks(uri, meta) { // Use proxy.cache_ttl or options.cache_ttl. // If options.cache_ttl === 0 and no proxy.cache_ttl, then CONFIG.CACHE_TTL will be used. ttl: utils.getMaxCacheTTL(uri, options), - refreshing: options.refresh + refresh: options.refresh }); } diff --git a/lib/request.js b/lib/request.js index 690e7675f..d5f02436e 100644 --- a/lib/request.js +++ b/lib/request.js @@ -132,7 +132,7 @@ export default function(options, iframely_options, callback) { data: data }, { ttl: ttl, - refreshing: refresh + refresh: refresh }); // temp cache migration, set new key as well @@ -145,7 +145,7 @@ export default function(options, iframely_options, callback) { data: data }, { ttl: ttl, - refreshing: refresh + refresh: refresh }); } } @@ -210,7 +210,7 @@ export default function(options, iframely_options, callback) { if (new_cache_key) { cache.set('req:' + prefix + new_cache_key, data, { ttl: ttl, - refreshing: refresh + refresh: refresh }); }