Skip to content

perf: compress the feed and answer unchanged requests with 304 - #6

Merged
m1ngsama merged 1 commit into
mainfrom
perf/compress-and-revalidate
Sep 26, 2026
Merged

m1ngsama merged 1 commit into
mainfrom
perf/compress-and-revalidate

Conversation

@m1ngsama

@m1ngsama m1ngsama commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Decision: merging deploys to ical.nbtca.space. Right after, check that a client refusing gzip still gets plain text: curl -sD - -H 'Accept-Encoding: identity' https://ical.nbtca.space | head must show no Content-Encoding: gzip. Workers see a normalized Accept-Encoding and rely on the edge to decode for such clients, which wrangler dev cannot show. (src/index.js, respond)

The events feed is 87 KB of uncompressed text, re-sent in full on every request, and slow links spend seconds on it.

  • Responses carry Content-Encoding: gzip when the client accepts it, so the runtime compresses them: 87,046 → 17,701 bytes in wrangler dev. Vary: Accept-Encoding is set.
  • When Google sends no ETag, the worker reuses the existing strongEtag (SHA-256 of the body); Cloudflare weakens it when compressing, and comparisons ignore the W/ prefix.
  • If-None-Match (weak comparison, lists, *) and If-Modified-Since are answered with an empty 304; the last-good fallback and /project.ics get the same treatment.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ical 45c69e1 Commit Preview URL

Branch Preview URL
Sep 26 2026, 02:00 PM

@m1ngsama
m1ngsama force-pushed the perf/compress-and-revalidate branch from b814c02 to 45c69e1 Compare September 26, 2026 14:00
@m1ngsama
m1ngsama merged commit 35d2368 into main Sep 26, 2026
2 checks passed
@m1ngsama
m1ngsama deleted the perf/compress-and-revalidate branch September 26, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant