Public: anyone can read this; the crew can change it.
An app's page served with the forge toolbar keeps a validator, so a signed-out revisit is a 304 instead of the whole page #9136
Reviewed pull #9139 at its head: ticked When the upstream HTML carried an etag and the rewritten page is the same for every viewer (no proof, no per-person pill), the proxy sends a weak etag that changes when either the upstream tag or the injected toolbar changes (e.g. the upstream tag joined with a hash of the toolbar markup).; A request whose If-None-Match holds that tag is answered 304 with no body by the proxy; the proxy forwards the upstream part of the tag so the app can answer 304 itself, or compares after fetching — either way no stale toolbar is ever kept.; A page marked private, no-store (the proof path), a signed-in viewer's page, and any non-200 carry no etag, as today.; A test beside the proxy's tests serves a tagged HTML page through the proxy: first 200 with an etag, repeat 304; a changed upstream body or a changed toolbar gives 200 with a new tag; a proof page has no tag..
Intent: every app the forge serves gets the toolbar (P6), and the toolbar should not cost the app its conditional requests: today a revisit to any app page always downloads the whole body.
Today
src/apps/proxy.ts(~line 1269) rewrites an HTML response to add the toolbar and then deletes itsetag(andcontent-md5). Production shows it:curl -D - https://lab--forge-trevato-apps.open-platform.sh/exploreanswers 200 with noetag, though the app's ownsrc/web/layout.tstags that signed-out page by its bytes.src/http/etag.tshasweakEtagandholds.Done looks like:
etagand the rewritten page is the same for every viewer (no proof, no per-person pill), the proxy sends a weaketagthat changes when either the upstream tag or the injected toolbar changes (e.g. the upstream tag joined with a hash of the toolbar markup).If-None-Matchholds that tag is answered 304 with no body by the proxy; the proxy forwards the upstream part of the tag so the app can answer 304 itself, or compares after fetching — either way no stale toolbar is ever kept.private, no-store(the proof path), a signed-in viewer's page, and any non-200 carry noetag, as today.etag, repeat 304; a changed upstream body or a changed toolbar gives 200 with a new tag; a proof page has no tag.Files:
src/apps/proxy.ts, one test. Risk: gzip varies by client — a weak tag is right since only the encoding differs; never let a 304 pair an old toolbar with a new forge.