MCPcopy Index your code
hub / github.com/github/docs / setStaticAssetCaching

Function setStaticAssetCaching

middleware/static-asset-caching.js:3–8  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

1import { setFastlySurrogateKey, SURROGATE_ENUMS } from './set-fastly-surrogate-key.js'
2
3export default function setStaticAssetCaching(req, res, next) {
4 if (isChecksummed(req.path)) {
5 setFastlySurrogateKey(res, SURROGATE_ENUMS.MANUAL)
6 }
7 return next()
8}
9
10// True if the URL is known to contain some pattern of a checksum that
11// would make it intelligently different if its content has changed.

Callers

nothing calls this directly

Calls 3

setFastlySurrogateKeyFunction · 0.90
isChecksummedFunction · 0.85
nextFunction · 0.50

Tested by

no test coverage detected