diff --git a/.changeset/url-load-proxy-revalidate.md b/.changeset/url-load-proxy-revalidate.md new file mode 100644 index 000000000..6fd373c09 --- /dev/null +++ b/.changeset/url-load-proxy-revalidate.md @@ -0,0 +1,5 @@ +--- +'@be-music/worker-play': patch +--- + +An embed `?track=` or player `?music=` archive from another origin was downloaded in full on every load, because `/__url-load-proxy` answered `no-store` and dropped the host's validators. The proxy now answers `no-cache` and passes `ETag` / `Last-Modified` and the browser's `If-None-Match` / `If-Modified-Since` through, so an unchanged archive comes back as a 304 from the browser's cache. diff --git a/docs/player-web.ja.md b/docs/player-web.ja.md index 8c6d471a2..042cc97bb 100644 --- a/docs/player-web.ja.md +++ b/docs/player-web.ja.md @@ -875,7 +875,7 @@ PixiJS scene wiring は browser rendering や WebAudio resource に依存する ## 埋め込みプレビュー -`/embed/?track=`(`play.be-music.app`、プレビュー環境は `play.preview.be-music.app`)は、譜面のアーカイブを iframe の中でプレビューする。`@be-music/app-play` の 2 つ目のエントリ(`embed/index.html`、`src/embed/`)で、同じ Worker が配信する。Worker は iframe では自動サインインを始めない。アーカイブは `?music=` と同じく、同じオリジンからは直接、別の https オリジンからは `/__url-load-proxy` を経由して取得する。 +`/embed/?track=`(`play.be-music.app`、プレビュー環境は `play.preview.be-music.app`)は、譜面のアーカイブを iframe の中でプレビューする。`@be-music/app-play` の 2 つ目のエントリ(`embed/index.html`、`src/embed/`)で、同じ Worker が配信する。Worker は iframe では自動サインインを始めない。アーカイブは `?music=` と同じく、同じオリジンからは直接、別の https オリジンからは `/__url-load-proxy` を経由して取得する。ブラウザはアーカイブを保存し、読み込むたびに再検証する。プロキシは `no-cache` を付け、配信元の `ETag` / `Last-Modified` とブラウザの条件付きリクエストを中継するので、変わっていないアーカイブはダウンロードし直さない。どちらの検証子も送らない配信元からは毎回ダウンロードする。 ```html