From e83103c6b55737f58d777c885464695bd68a9703 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Sun, 6 Jan 2019 21:15:24 -0800 Subject: [PATCH] Increase redirect timeout to 5 minutes --- modules/middleware/fetchPackage.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/middleware/fetchPackage.js b/modules/middleware/fetchPackage.js index 12edc1e..37e87ef 100644 --- a/modules/middleware/fetchPackage.js +++ b/modules/middleware/fetchPackage.js @@ -9,10 +9,9 @@ const incrementCounter = require('../utils/incrementCounter'); function tagRedirect(req, res) { const version = req.packageInfo['dist-tags'][req.packageVersion]; - // Cache tag redirects for 1 minute. res .set({ - 'Cache-Control': 'public, max-age=60', + 'Cache-Control': 'public, max-age=300', // 5 minutes 'Cache-Tag': 'redirect, tag-redirect' }) .redirect( @@ -28,10 +27,9 @@ function semverRedirect(req, res) { ); if (maxVersion) { - // Cache semver redirects for 1 minute. res .set({ - 'Cache-Control': 'public, max-age=60', + 'Cache-Control': 'public, max-age=300', // 5 minutes 'Cache-Tag': 'redirect, semver-redirect' }) .redirect(