mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 02:35:06 +08:00
docs: add cache-control headers
This commit is contained in:
parent
9d744710da
commit
7acc109c0c
4
.github/workflows/deploy-pages.yml
vendored
4
.github/workflows/deploy-pages.yml
vendored
@ -126,6 +126,4 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
cf_zone: ${{ secrets.CF_ZONE_ID }}
|
cf_zone: ${{ secrets.CF_ZONE_ID }}
|
||||||
cf_auth: ${{ secrets.CF_API_TOKEN }}
|
cf_auth: ${{ secrets.CF_API_TOKEN }}
|
||||||
hosts: |
|
|
||||||
modular-avatar.nadena.dev
|
|
@ -74,6 +74,7 @@ async function handleEvent(event) {
|
|||||||
Vary: 'Accept-Language',
|
Vary: 'Accept-Language',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
response.headers.set("Cache-Control", "private");
|
||||||
} else if (strip_match !== null) {
|
} else if (strip_match !== null) {
|
||||||
console.log("=== Redirect");
|
console.log("=== Redirect");
|
||||||
response = new Response("Redirecting", {
|
response = new Response("Redirecting", {
|
||||||
@ -82,6 +83,7 @@ async function handleEvent(event) {
|
|||||||
Location: strip_match[1],
|
Location: strip_match[1],
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
response.headers.set("Cache-control", "public,max-age=3600");
|
||||||
} else {
|
} else {
|
||||||
let page;
|
let page;
|
||||||
try {
|
try {
|
||||||
@ -97,6 +99,7 @@ async function handleEvent(event) {
|
|||||||
|
|
||||||
// allow headers to be altered
|
// allow headers to be altered
|
||||||
response = new Response(page.body, page);
|
response = new Response(page.body, page);
|
||||||
|
response.headers.set("Cache-control", "public,max-age=3600");
|
||||||
}
|
}
|
||||||
|
|
||||||
response.headers.set("X-XSS-Protection", "1; mode=block");
|
response.headers.set("X-XSS-Protection", "1; mode=block");
|
||||||
|
Loading…
Reference in New Issue
Block a user