Static assets get no configurable headers on native Cloudflare deploys of framework apps
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 50/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript, vite
- Bereich
- cloud
Rechercherichtung
Start by tracing uploadAssets, readGeneratedAssetHeaders, and planAssetWorkerBypass for native Cloudflare deploys, then compare their behavior with the TanStack Start asset configuration described here. Check or add coverage for user-authored _headers and fingerprinted assets; done means the reported cache headers are applied to static assets, or the docs accurately describe the limitation.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
A TanStack Start app deployed with void deploy --platform cloudflare serves its static assets without any configurable headers:
- A
public/_headersfile is copied todist/client/_headers, but it never applies in production.uploadAssetsignores/_headers, andreadGeneratedAssetHeadersonly sends a file whose first line is Void's generated marker ("A user-authored_headersis not sent on this path"). - Void's own immutable caching for fingerprinted bundles never runs either.
planAssetWorkerBypassonly applies when the builtwrangler.jsonhasassets.run_worker_first: ["/**"], and the TanStack Start build has only"assets": { "directory": "../client" }. With the_headersfile removed, the build generates no_headersat all. - As a result, hashed files under
/assets/are served with Cloudflare's defaultCache-Control: public, max-age=0, must-revalidate. Browsers revalidate every JS and CSS chunk on every page view.
This contradicts two docs pages:
guide/edge/static-assets.md("Native Cloudflare deployments"): "Withvoid deploy --platform cloudflare, generated JavaScript bundles with content fingerprints receive immutable caching."guide/edge/headers.md("Framework_headersfiles"): "Void reads_headersfiles produced by supported frameworks."
Reproduction
[email protected],@tanstack/[email protected], Vite 8, deployed withvoid deploy --platform cloudflarevoid.config.tssetscloudflare.cache.enabled, a custom domain route, a D1 binding and noroutingoptionspublic/_headers:/assets/* Cache-Control: public, max-age=31536000, immutable- After deploy,
curl -sI https://<site>/assets/<hashed>.jsshowscache-control: public, max-age=0, must-revalidate. CSS is the same.
I also tried routing.headers in void.config.ts ('/assets/*': ['Cache-Control: public, max-age=31536000, immutable']). In the local preview (vite preview in workerd), assets still came back with max-age=0, must-revalidate. I didn't deploy that variant, since the assets are served without starting the Worker, so I don't expect the rules to reach them.
Expected
One of these, for framework apps on native Cloudflare deploys:
- send a user-authored
_headerswith the asset upload (as Wrangler does), - generate the immutable
_headersfor fingerprinted files even withoutrun_worker_first, or - apply
routing.headersto static assets.
Failing those, the docs should say framework apps on --platform cloudflare get no asset headers.
Workaround
A Response Header Transform Rule on the zone that sets Cache-Control: public, max-age=31536000, immutable for a 200 under /assets/.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 627
- Forks
- 66
- Ø Merge
- 13 Std. 57 Min.
- Gemergte PRs (30 T.)
- 194
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/void
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
voidzero-dev/void#677 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Export a guard for `VoidActionError` at every statusEvtl. vergeben @karthickeyan-dev hat das heute übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
voidzero-dev/void#714 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
voidzero-dev/void#713 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
`@void/solid`: `useParams()` keeps the first page's params after client-side navigationEvtl. vergeben @yujiym hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 20/100
voidzero-dev/void#708 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
voidzero-dev/void#692 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/void
Ähnliche Issues
-
[Text] Add Reading Time & Word Count Estimator for Reflection Notes in src/lib/text/reading-time.tsOffenarea:core beginner-friendly community contributions-welcome difficulty:easy enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timingOffene2e-failure ready-to-code
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
devswha/herdr-web-ui#2884 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
b:minor bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
software-mansion/argent#1771 ·
Maintainer antworten meist innerhalb von 1 Tag