1
0
mirror of synced 2025-12-23 03:44:00 -05:00

Remove cacheControlFactory export (#33255)

This commit is contained in:
Kevin Heis
2022-12-06 12:26:36 -08:00
committed by GitHub
parent ff12bf6131
commit e791da01a6
4 changed files with 33 additions and 29 deletions

View File

@@ -1,9 +1,7 @@
import FailBot from '../lib/failbot.js'
import { nextApp } from './next.js'
import { setFastlySurrogateKey, SURROGATE_ENUMS } from './set-fastly-surrogate-key.js'
import { cacheControlFactory } from './cache-control.js'
const cacheControl = cacheControlFactory(60) // 1 minute
import { errorCacheControl } from './cache-control.js'
function shouldLogException(error) {
const IGNORED_ERRORS = [
@@ -39,7 +37,7 @@ export default async function handleError(error, req, res, next) {
// Let's cache our 404'ing assets conservatively.
// The Cache-Control is short, and let's use the default surrogate
// key just in case it was a mistake.
cacheControl(res)
errorCacheControl(res)
// Makes sure the surrogate key is NOT the manual one if it failed.
// This basically unsets what was assumed in the beginning of
// loading all the middlewares.