Skip to content

Commit ea4f766

Browse files
committed
Merge remote-tracking branch 'origin/main' into next
# Conflicts: # ecosystem/plugins/zsh_lint.mdx
2 parents 8cc3678 + 3f8f6cc commit ea4f766

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

ecosystem/plugins/zsh_lint.mdx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ zsh-lint path/to/file.zsh another.zsh
3636
Each file gets an `OK`/`FAIL` line; failures include a greppable
3737
`path:line:col: message`. The exit code is `0` only if every file parsed.
3838

39-
## Reference
40-
41-
The section below is generated from the project's Go doc comments and synced
42-
automatically. Do not edit it by hand.
43-
44-
{/* zsh-lint:generated:start */}
45-
46-
_Reference content is injected here by the `wiki-docs-sync` workflow._
47-
48-
{/* zsh-lint:generated:end */}
49-
5039
{/* end-of-file */}
5140
{/* links */}
5241
{/* external */}

functions/[[path]].ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ interface Env {
44
ASSETS_BUCKET: R2Bucket;
55
}
66

7+
const immutableAssetPrefixes = ["/assets/", "/cdn/", "/img/"];
8+
79
export const onRequest: PagesFunction<Env> = async (context) => {
810
if (context.request.method === "OPTIONS") {
911
return new Response(null, {
@@ -46,7 +48,11 @@ export const onRequest: PagesFunction<Env> = async (context) => {
4648

4749
const headers = new Headers();
4850
object.writeHttpMetadata(headers);
49-
headers.set("Cache-Control", "public, max-age=31536000, immutable");
51+
if (immutableAssetPrefixes.some((prefix) => url.pathname.startsWith(prefix))) {
52+
headers.set("Cache-Control", "public, max-age=31536000, immutable");
53+
} else if (!headers.has("Cache-Control")) {
54+
headers.set("Cache-Control", "public, max-age=300");
55+
}
5056
headers.set("ETag", object.httpEtag);
5157
headers.set("Access-Control-Allow-Origin", "*");
5258
headers.set("Accept-Ranges", "bytes");

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
"lint:links": "trunk check --filter lychee",
2020
"lint:links:all": "trunk check --all --filter lychee",
2121
"lint:links:refresh": "trunk check --all --filter lychee --cache=false",
22-
"project-health": "pnpm lint && pnpm build:en",
22+
"project-health": "pnpm lint && pnpm wrangler:typecheck && pnpm build:en",
2323
"serve": "docusaurus serve",
2424
"start": "docusaurus start",
2525
"start:cf": "wrangler pages dev build --remote",
2626
"swizzle": "docusaurus swizzle",
2727
"validate:frontmatter": "node scripts/validate-frontmatter.mjs",
28+
"wrangler:typecheck": "tsc -p functions/tsconfig.json",
2829
"wrangler:types": "wrangler types --path='./functions/worker-env.d.ts'",
2930
"write-docs-version": "docusaurus docs:version",
3031
"write-heading-ids": "docusaurus write-heading-ids",

0 commit comments

Comments
 (0)