1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/middleware/fast-head.js
2022-11-30 00:04:34 +00:00

15 lines
378 B
JavaScript

import { defaultCacheControl } from './cache-control.js'
export default function fastHead(req, res, next) {
const { context } = req
const { page } = context
if (page) {
// Since the *presence* is not affected by the request, we can cache
// this and allow the CDN to hold on to it.
defaultCacheControl(res)
return res.status(200).send('')
}
next()
}