Skip to content

Commit e68479c

Browse files
committed
fix: Fix cache? No idea why ts won't work
1 parent c7b5301 commit e68479c

File tree

10 files changed

+10
-25
lines changed

10 files changed

+10
-25
lines changed

apps/docs/firebase.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,6 @@
1616
"destination": "/users/parting-ways/uninstall",
1717
"type": 301
1818
}
19-
],
20-
"headers": [
21-
{
22-
"source": "**",
23-
"headers": [
24-
{
25-
"key": "Cache-Control",
26-
"value": "public, max-age=1800, s-maxage=1800"
27-
}
28-
]
29-
}
3019
]
3120
}
3221
}

apps/www/firebase.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
"ignore": [],
1010
"frameworksBackend": {
1111
"region": "us-central1"
12-
},
13-
"headers": [
14-
{
15-
"source": "**",
16-
"headers": [
17-
{
18-
"key": "Cache-Control",
19-
"value": "public, max-age=1800, s-maxage=1800"
20-
}
21-
]
22-
}
23-
]
12+
}
2413
}
2514
}

apps/www/src/app/api/millennium/stats/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function getDownloadCountAndLatestVersion() {
2020
while (true) {
2121
try {
2222
const url = `${baseUrl}?per_page=${perPage}&page=${page}`;
23-
const res = await fetch(url, { headers });
23+
const res = await fetch(url, { headers, next: { revalidate: 1800 } });
2424

2525
if (!res.ok) {
2626
throw new Error(`GitHub API request failed: ${res.status} ${res.statusText}`);

apps/www/src/app/api/v1/plugins/GetDownloadInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const GetDownloadInfo = async () => {
55
Authorization: process.env.BEARER!,
66
'Content-Type': 'application/json',
77
},
8+
next: { revalidate: 1800 },
89
})
910
.then((text) => text.json())
1011
.then((data) => {

apps/www/src/app/api/v1/plugins/GetPluginData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const GetPluginData = (pluginList) => {
8989
'Content-Type': 'application/json',
9090
},
9191
body: JSON.stringify({ query }),
92+
next: { revalidate: 1800 },
9293
});
9394

9495
const pluginData = await Firebase.GetPluginData();

apps/www/src/app/api/v1/plugins/GetPluginList.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const RetrievePluginList = async () => {
77
Authorization: process.env.BEARER!,
88
'Content-Type': 'application/json',
99
},
10+
next: { revalidate: 1800 },
1011
})
1112
.then((text) => text.json())
1213
.then((data) => {

apps/www/src/app/api/v1/plugins/GetPluginMetadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const GetPluginMetadata = async () => {
1010
Authorization: process.env.BEARER!,
1111
'Content-Type': 'application/json',
1212
},
13+
next: { revalidate: 1800 },
1314
})
1415
.then((text) => text.json())
1516
.then((data) => {

apps/www/src/app/api/v2/GraphQLInterop.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const GithubGraphQL = {
88
...(process.env.BEARER ? { Authorization: process.env.BEARER } : {}),
99
},
1010
body: JSON.stringify({ query: body }),
11+
next: { revalidate: 1800 },
1112
})
1213
.then((response) => response.json())
1314
.then((json) => {

apps/www/src/app/api/v2/details/[slug]/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function getDiscordInfo(token: string): Promise<DiscordInfo> {
4545
const apiUrl = `https://discord.com/api/v9/invites/${cleanToken}?with_counts=true&with_expiration=true`;
4646

4747
try {
48-
const response = await fetch(apiUrl);
48+
const response = await fetch(apiUrl, { next: { revalidate: 1800 } });
4949

5050
if (!response.ok) {
5151
if (response.status === 404) {

apps/www/src/app/api/v2/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { GraphQLFeatured } from './GraphQLHandler';
55
import { GithubGraphQL } from './GraphQLInterop';
66
import { Firebase } from '../Firebase';
77

8+
export const revalidate = 1800;
9+
810
function getDate(unixTime: number): string {
911
const d = new Date(unixTime * 1000);
1012
return `${d.toISOString().slice(0, 19)}Z`;

0 commit comments

Comments
 (0)