Skip to content

Commit 0e96315

Browse files
fix: add correct headers to next.config.js and remove redundent amplify.yml
1 parent 46f703a commit 0e96315

2 files changed

Lines changed: 29 additions & 59 deletions

File tree

amplify.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

next.config.js

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,64 @@ const config = {
1616
{
1717
source: "/api/upcoming-papers",
1818
headers: [
19-
{ key: "Cache-Control", value: "s-maxage=60, stale-while-revalidate=120" },
19+
{
20+
key: "Cache-Control",
21+
value: "public, s-maxage=60, stale-while-revalidate=120",
22+
},
2023
],
2124
},
2225
{
2326
source: "/api/papers",
2427
headers: [
25-
{ key: "Cache-Control", value: "s-maxage=60, stale-while-revalidate=120" },
28+
{
29+
key: "Cache-Control",
30+
value: "public, s-maxage=60, stale-while-revalidate=120",
31+
},
2632
],
2733
},
2834
{
2935
source: "/api/selected-papers",
3036
headers: [
31-
{ key: "Cache-Control", value: "s-maxage=60, stale-while-revalidate=120" },
37+
{
38+
key: "Cache-Control",
39+
value: "public, s-maxage=60, stale-while-revalidate=120",
40+
},
3241
],
3342
},
3443
{
3544
source: "/api/related-subject",
3645
headers: [
37-
{ key: "Cache-Control", value: "s-maxage=60, stale-while-revalidate=120" },
46+
{
47+
key: "Cache-Control",
48+
value: "public, s-maxage=60, stale-while-revalidate=120",
49+
},
3850
],
3951
},
4052
{
4153
source: "/api/course-list",
4254
headers: [
43-
{ key: "Cache-Control", value: "s-maxage=60, stale-while-revalidate=120" },
55+
{
56+
key: "Cache-Control",
57+
value: "public, s-maxage=60, stale-while-revalidate=120",
58+
},
4459
],
4560
},
4661
{
4762
source: "/_next/static/:path*",
4863
headers: [
49-
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
64+
{
65+
key: "Cache-Control",
66+
value: "public, max-age=31536000, immutable",
67+
},
5068
],
5169
},
5270
{
53-
source: "/:all*(css|js|png|jpg|jpeg|gif|webp|svg|ico|woff|woff2)",
71+
source: "/:path*\\.(css|js|png|jpg|jpeg|gif|webp|svg|ico|woff|woff2)",
5472
headers: [
55-
{ key: "Cache-Control", value: "public, max-age=604800, stale-while-revalidate=86400" },
73+
{
74+
key: "Cache-Control",
75+
value: "public, max-age=604800, stale-while-revalidate=86400",
76+
},
5677
],
5778
},
5879
];

0 commit comments

Comments
 (0)