Skip to content

Commit

Permalink
cloudflare immutable headers
Browse files Browse the repository at this point in the history
  • Loading branch information
rossrobino committed Sep 5, 2024
1 parent b869f97 commit fcdb7e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/domco/src/adapter/cloudflare/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dirNames } from "../../constants/index.js";
import { dirNames, headers } from "../../constants/index.js";
import type { AdapterBuilder } from "../../types/public/index.js";
import {
clearDir,
Expand Down Expand Up @@ -123,6 +123,10 @@ export const adapter: AdapterBuilder = async () => {
path.join(outDir, "_routes.json"),
JSON.stringify(routes, null, "\t"),
),
fs.writeFile(
path.join(outDir, "_headers"),
`/${dirNames.out.client.immutable}/*\n ! Cache-Control\n\tCache-Control: ${headers.cacheControl.immutable}`,
),
]);
},
};
Expand Down

0 comments on commit fcdb7e9

Please sign in to comment.