diff --git a/lolisafe.js b/lolisafe.js index 9f0cc78..7e4cc52 100644 --- a/lolisafe.js +++ b/lolisafe.js @@ -34,9 +34,8 @@ safe.use(bodyParser.json()) const setHeaders = (res, path, stat) => { if (/\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|js|css|eot|svg|ttf|woff|woff2)$/.test(path)) { - const day = 86400 res.set('Access-Control-Allow-Origin', '*') - res.set('Cache-Control', `public, max-age=${day * 30}, must-revalidate, proxy-revalidate, immutable, stale-while-revalidate=86400, stale-if-error=604800`) // 30 days + res.set('Cache-Control', `public, max-age=2592000, must-revalidate, proxy-revalidate, immutable, stale-while-revalidate=86400, stale-if-error=604800`) // max-age: 30 days } } @@ -60,7 +59,7 @@ for (let page of config.pages) { } } -// NOTE: Uses fiery-me branch of https://github.com/BobbyWibowo/HttpErrorPages +// NOTE: Uses fiery.me branch of https://github.com/BobbyWibowo/HttpErrorPages safe.use((req, res, next) => { res.status(404).sendFile('HTTP404.html', { root: '../HttpErrorPages/dist/' }) })