Skip to content

Aggressive edge caching and query optimization#3

Merged
gavyncaldwell merged 2 commits intomainfrom
fix/aggressive-caching
Mar 13, 2026
Merged

Aggressive edge caching and query optimization#3
gavyncaldwell merged 2 commits intomainfrom
fix/aggressive-caching

Conversation

@gavyncaldwell
Copy link
Collaborator

Summary

  • Bump all edge cache TTLs to 1 week (data only changes on manual seed runs, then pnpm cache:purge)
  • Add Crawl-delay: 10 to robots.txt to throttle bot traffic
  • Rewrite desktopOnlyAppIds from 4 nested subqueries to single JOIN + HAVING (reduces Turso row reads)
  • Auto-purge Cloudflare cache after seed:import and seed:enrich

Context

Hit 500M Turso reads overnight from a combination of crawler stampede (post-SEO deploy), short cache TTLs, and the expensive nested desktop filter query running on every page load.

- bump all cache TTLs to 1 week (data only changes on manual seed runs)
- add crawl-delay to robots.txt to throttle bot traffic
- rewrite desktopOnlyAppIds from 4 nested subqueries to single JOIN + HAVING
- auto-purge Cloudflare cache after seed:import and seed:enrich
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2026

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
unclouded e6908e9 Commit Preview URL

Branch Preview URL
Mar 13 2026, 02:30 PM

@gavyncaldwell gavyncaldwell merged commit a0afb15 into main Mar 13, 2026
2 checks passed
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