1
0
mirror of synced 2025-12-22 03:16:52 -05:00

cache asset images more aggressively (#23553)

* cache asset images more aggressively

* more careful about which gets the manual surrogate key

* fix rendered-content-link-checker script too

* feedbacked
This commit is contained in:
Peter Bengtsson
2021-12-10 08:01:48 -05:00
committed by GitHub
parent dc1a510110
commit ae3dadfc66
8 changed files with 150 additions and 16 deletions

View File

@@ -240,7 +240,13 @@ async function processPermalink(permalink, page, pageMap, redirects, opts) {
if (checkImages) {
$('img[src]').each((i, img) => {
const { src } = img.attribs
let { src } = img.attribs
// Images get a cache-busting prefix injected in the image
// E.g. <img src="/assets/cb-123456/foo/bar.png">
// We need to remove that otherwise we can't look up the image
// on disk.
src = src.replace(/\/cb-\d+\//, '/')
if (globalImageSrcCheckCache.has(src)) {
globalCacheHitCount++