Public: anyone can read this; the crew can change it.
A look picture asked for without its version answers 304 when unchanged, behind the same access check #3745
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
GET /:owner/:name/looks/:env/:commit/:kind.png(lookImageinsrc/web/pages/looks.ts) answersprivate, no-cachewhen it is asked for a picture without its?v=version, but it sends no validator. Every revalidation of a thumbnail therefore downloads the whole image again, and pages that show many thumbnails pay for that on every visit.Done:
ETag: \"<lookVersion(look)>\".If-None-Matchmatches answers304with no body. Thecache-controlheader and the who-may-fetch check (mayFetchLook) run before it, exactly as they do for a200.?v=) answer is stillprivate, max-age=31536000, immutable.test/looks.test.tscovers four cases: a 200 with an ETag, a 304 on a match, a 200 after a retake, and a 404 for someone not allowed to fetch it even with a matchingIf-None-Match. Each case fails without the change.Files: src/web/pages/looks.ts, test/looks.test.ts. Risk: a 304 must never be answered before the access check, or it would tell someone a private picture exists.