feat: add support for static asset caching (#133)

This commit is contained in:
Sylvain Cau
2022-03-16 16:49:47 +01:00
committed by GitHub
parent 8aa1b250b8
commit 6cbcc27646
9 changed files with 93 additions and 20 deletions
+7 -1
View File
@@ -1,4 +1,5 @@
export const INTERNAL_PREFIX = "/_frsh";
import { INTERNAL_PREFIX } from "../runtime/utils.ts";
export const REFRESH_JS_URL = `${INTERNAL_PREFIX}/refresh.js`;
export const ALIVE_URL = `${INTERNAL_PREFIX}/alive`;
export const BUILD_ID = Deno.env.get("DENO_DEPLOYMENT_ID") ||
@@ -10,8 +11,13 @@ export function bundleAssetUrl(path: string) {
return `${INTERNAL_PREFIX}${JS_PREFIX}/${BUILD_ID}${path}`;
}
globalThis.__FRSH_BUILD_ID = BUILD_ID;
declare global {
interface Crypto {
randomUUID(): string;
}
// deno-lint-ignore no-var
var __FRSH_BUILD_ID: string;
}