Repository navigation
Defeat the Edge Cache in the Media Check and Name the Zone Settings - #496
Conversation
The live check asks for each media file with a per-run query, on the first request and on the legacy hop, so an edge copy cannot answer for a file a release lost. Page classes gain no-transform, which opts the bundle out of Cloudflare's content rewrites whatever the zone enables. deploy/README.md names the Browser Cache TTL and Caching Level the lifetimes depend on, and OPERATIONS.md corrects the robots.txt default and says client_ip is client-chosen behind Cloudflare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #496 +/- ##
========================================
Coverage 49.70% 49.70%
========================================
Files 10 10
Lines 3058 3058
========================================
Hits 1520 1520
Misses 1538 1538
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
Address the no-cache wording and Markdown link-style findings before approval.
No open issues 🎉
What changed in this PR
This pull request prepares the media validation gate and deployment guidance for operation behind Cloudflare, while serving compressed error pages consistently.
Changes:
- Adds per-run cache-busting queries to media checks, including legacy redirect hops, with regression coverage.
- Documents Cloudflare cache-zone settings and proxied client-IP handling.
- Enables precompressed Brotli and gzip serving for the blog error page.
| File | Reviewed changes |
|---|---|
OPERATIONS.md |
Documents Cloudflare caching and client-address handling. [P2] The no-cache guidance should describe revalidation rather than implying that responses cannot be stored at the edge (1 vote; moderate). |
deploy/README.md |
Names the required Browser Cache TTL and Caching Level settings and documents proxy behavior. The new OPERATIONS.md link should follow the repository’s reference-style link convention (1 vote; nit). |
deploy/Caddyfile |
Serves the blog error page through precompressed siblings. |
checks/tests/test_check_live_urls_sample.py |
Verifies unique per-run media query tokens and query handling across redirect hops. |
checks/check-live-urls.sh |
Adds per-run cache-busting queries to media checks and legacy media destinations. |
Review effort: Lite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Answering the two findings the review on f31c0c5 names in its file table, both fixed in 61ded16.
A local strict review pass over 61ded16 found nothing. |
Summary
Follow-ups to #492 from the host side's review of it on ptr727/HomeAutomation-Config#580. They land before the first release that runs its gate against a proxied hostname. The family site went proxied at 2026-10-24T01:47Z.
checks/check-live-urls.sh:check_mediaasks for each media file with a per-run?live-check=<epoch>-<pid>query, on the first request and on the legacy/wp-content/uploads/hop, whose redirect drops the query. Cloudflare's default cache key includes the query string, so an edge copy cannot answer for a file a release lost. The host side measured that CrowdSec strips the query before classing a path static, so the production crawl budget is unchanged.checks/tests/test_check_live_urls_sample.py: a full run asks for every media path, the hop included, with one token per run, and two runs use different tokens. The mock drops the query on the legacy redirect, as Caddy does.deploy/Caddyfile: the blog's error page is served from its precompressed siblings, as every other page is.deploy/README.md: "Cache lifetimes" names the two zone settings the lifetimes depend on. Browser Cache TTL must be "Respect Existing Headers", since a new zone's 4-hour default replaces any shorter origin lifetime. Caching Level must not be "Ignore Query String", which would defeat the media query. The section is one paragraph per line, which also answers the Copilot note on Promote the Edge Proxy Cache Lifetimes #494. "Trusting the proxy" saysclient_ipis client-chosen behind Cloudflare.OPERATIONS.md: Cloudflare cachesrobots.txtby default, and itsno-cacheanswer keeps it from being stored. Behind Cloudflare,client_ipis whatever the client wrote, so read the last element ofClientHostinstead.no-transformon the page classes was proposed too, and left out. Its effect on compression for a client that does not accept Brotli is undocumented, and #495 tracks measuring it.Verification
check-live-urls.shpassed 1294 URLs each time. The last release serves pages and the404page withno-cacheandcontent-encoding: br.robots.txtdefault caching.python3 -m unittest discover -s checks/testspassed 128 tests. The new test fails without the hop's own query.prose_lint.py --diffreports only thecommentsfindings this PR's label answers, and--check sentence-lengthreports nothing.no-transformcompression question, and the maintainer chose to drop the directive. The fourth, over the final content, found nothing.Pre-existing findings, not filed
OPERATIONS.md:310,pre-existing: the reason given against a query-parameter check tag says a query pollutes the path.checks/log-review.jqalready drops the query from the key, so only the?p=collision half of that reason holds.🤖 Generated with Claude Code