## Summary
- Vite-built assets (JS chunks, CSS) were served with `Cache-Control:
no-cache, no-store` because the static files middleware only recognized
builder-path assets (under `/_fresh/js/{BUILD_ID}/`) as immutable
- Adds an `immutable` flag to `FileSnapshot`, `StaticFile`, and
`PendingStaticFile` interfaces
- The Vite plugin marks manifest chunks and CSS as `immutable: true`
(these have content-hashed filenames), while public directory files
remain non-immutable
- The static files middleware checks `file.immutable` alongside the
existing path and query param checks
Closes #3282
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fresh vite plugin
Vite plugin for Fresh.
Usage
- Run
deno install jsr:@fresh/plugin-vite npm:vite - Ensure that your
deno.jsonhas thefreshimport mapping:
{
"imports": {
"fresh": "jsr:@fresh/core"
}
}
- Update your
vite.config.tsfile:
import { defineConfig } from "vite";
+ import { fresh } from "@fresh/plugin-vite";
export default defineConfig({
plugins: [
+ fresh(),
],
});
- Update your deno tasks respectively:
- Dev:
vite - Build:
vite build
More information on the Fresh documentation .