1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/middleware/set-fastly-cache-headers.js
James M. Greene c940dcd98b Middleware overhaul! (#18218)
* Middleware overhaul!

- Remove unnecessary 'async' keywords from middleware functions
- Ensure all middleware functions we create have names
- Wrap the method contents of all async middleware functions in a try-catch+next(error) pattern

* Use asyncMiddleware wrapper instead of try-catch+next(error) pattern

* Remove unnecessary try-catch+next(error) pattern from context middleware
2021-03-11 01:12:41 +00:00

9 lines
255 B
JavaScript

module.exports = function setFastlyCacheHeaders (req, res, next) {
// Disallow both Fastly AND the browser from caching HTML pages
res.set({
'surrogate-control': 'private, no-store',
'cache-control': 'private, no-store'
})
return next()
}