Static assets get no configurable headers on native Cloudflare deploys of framework apps
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript, vite
- 領域
- cloud
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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/.
- 主要言語
- TypeScript
- スター
- 627
- フォーク
- 66
- 平均マージ
- 13時間 57分
- マージ済み PR(30日)
- 194
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/void のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
voidzero-dev/void#677 ·
メンテナーはふだん 1 日以内に返信
-
Export a guard for `VoidActionError` at every status対応中かも @karthickeyan-dev が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
voidzero-dev/void#714 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
voidzero-dev/void#713 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`@void/solid`: `useParams()` keeps the first page's params after client-side navigation対応中かも @yujiym が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 20/100
voidzero-dev/void#708 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
voidzero-dev/void#692 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/void の issue をすべて見る
似ている issue
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
liberation-data/drivine#615 ·
メンテナーはふだん 1 日以内に返信
-
backend bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
geolens-io/geolens#3639 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
radius-project/ai-extensions#1196 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100