Skip to content

Commit 1b506a3

Browse files
committed
Add Cache-Control for redirections
1 parent 338a3b7 commit 1b506a3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/utils/temple-ads-redirection.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ export const addTempleAdsRedirection = (
1212
const { extVersion: rawExtVersion, isMisesBrowser: rawIsMisesBrowser } = req.query;
1313
const extVersion = typeof rawExtVersion === 'string' ? rawExtVersion : '0.0.0';
1414
const isMisesBrowser = rawIsMisesBrowser === 'true';
15-
res.redirect(
16-
`${EnvVars.TEMPLE_ADS_API_URL}/v1/api/ads-rules/${extVersion}${templeAdsPathMainPart}${
17-
isMisesVariable ? (isMisesBrowser ? '/mises' : '/no-mises') : ''
18-
}`
19-
);
15+
res
16+
.header('Cache-Control', 'public, max-age=300')
17+
.redirect(
18+
`${EnvVars.TEMPLE_ADS_API_URL}/v1/api/ads-rules/${extVersion}${templeAdsPathMainPart}${
19+
isMisesVariable ? (isMisesBrowser ? '/mises' : '/no-mises') : ''
20+
}`
21+
);
2022
});
2123
};

0 commit comments

Comments
 (0)