Skip to content

Commit 0cf19bc

Browse files
authored
Updating Cache Control settings (#118)
1 parent 831ad60 commit 0cf19bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ const swaggerCustomOptions = {
8181
const openapiSpecification = swaggerJsdoc(swaggerOptions);
8282

8383
// set cache control middleware
84-
let setCache = function (req, res, next) {
84+
const setCache = (req, res, next) => {
8585
// period in seconds, currently 5 minutes
8686
// set this lower if we need to have more frequent update
8787
const period = 10
8888

8989
// cache only for GET requests
90-
if (req.method == 'GET') {
90+
if (req.method === 'GET') {
9191
res.set('Cache-control', `public, max-age=${period}`)
92-
} else if (req.hostname == 'kryptokrona.org') {
92+
} else if (req.hostname === 'kryptokrona.org') {
9393
res.set('Cache-control', `no-store`)
9494
} else {
9595
// for the other requests set strict no caching parameters

0 commit comments

Comments
 (0)