MCPcopy
hub / github.com/github/docs / fastHead

Function fastHead

middleware/fast-head.js:3–14  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

1import { defaultCacheControl } from './cache-control.js'
2
3export default function fastHead(req, res, next) {
4 const { context } = req
5 const { page } = context
6 if (page) {
7 // Since the *presence* is not affected by the request, we can cache
8 // this and allow the CDN to hold on to it.
9 defaultCacheControl(res)
10
11 return res.status(200).send('')
12 }
13 next()
14}

Callers

nothing calls this directly

Calls 2

defaultCacheControlFunction · 0.90
nextFunction · 0.50

Tested by

no test coverage detected