]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - middlewares/cache.js
4 var cacheMiddleware
= {
8 function cache (cache
) {
9 return function (req
, res
, next
) {
10 // If we want explicitly a cache
11 // Or if we don't specify if we want a cache or no and we are in production
12 if (cache
=== true || (cache
!== false && process
.env
.NODE_ENV
=== 'production')) {
13 res
.setHeader('Cache-Control', 'public')
15 res
.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate')
22 // ---------------------------------------------------------------------------
24 module
.exports
= cacheMiddleware