We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4a6bc2 commit 12cd897Copy full SHA for 12cd897
apps/functions/dns-redirecting/index.ts
@@ -47,7 +47,12 @@ export const dnsRedirecting = functions.https.onRequest(
47
const versionsData = await fetch('https://material.angular.dev/assets/versions.json').then(
48
(r) => r.json(),
49
);
50
- response.set('Content-Type', 'application/json').send(JSON.stringify(versionsData));
+ // 4 Days in seconds
51
+ const cacheDuration = 60 * 60 * 24 * 4;
52
+ response
53
+ .set('Cache-Control', `public, max-age=${cacheDuration}, s-maxage=${cacheDuration}`)
54
+ .set('Content-Type', 'application/json')
55
+ .send(JSON.stringify(versionsData));
56
return;
57
}
58
response.redirect(redirectType, `https://material.angular.dev${request.originalUrl}`);
0 commit comments