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:
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user