Increase redirect timeout to 5 minutes

This commit is contained in:
Michael Jackson 2019-01-06 21:15:24 -08:00
parent d6fde9fb33
commit e83103c6b5
1 changed files with 2 additions and 4 deletions

View File

@ -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(