Skip to content

Commit

Permalink
try adding cache-control header to redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuebert committed May 25, 2024
1 parent a038ba2 commit 951fa3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const pipeFile = async (res, path) => {
const redirectFile = async (res, path) => {
const signedUrl = await generateSignedUrl(path);
res.setHeader('Expires', new Date(Date.now() + 60 * 1000).toUTCString());
res.setHeader('Cache-Control', `public, max-age=${HTML_MAX_AGE}`);
return res.redirect(301, signedUrl);
};

Expand Down

0 comments on commit 951fa3b

Please sign in to comment.