perf: reduce Vercel data transfer costs with CDN optimization#1057
Merged
perf: reduce Vercel data transfer costs with CDN optimization#1057
Conversation
- Increase polling intervals (markets 8→12min, feeds 15→20min, crypto 8→12min) - Increase background tab hiddenMultiplier from 10→30 (polls 3x less when hidden) - Double CDN s-maxage TTLs across all cache tiers in gateway - Add CDN-Cache-Control header for Cloudflare-specific longer edge caching - Add ETag generation + 304 Not Modified support in gateway (zero-byte revalidation) - Add CDN-Cache-Control to bootstrap endpoint - Add explicit SPA rewrite rule in vercel.json for CF proxy compatibility - Add Cache-Control headers for /map-styles/, /data/, /textures/ static paths
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
aldoyh
pushed a commit
to aldoyh/worldmonitor
that referenced
this pull request
Mar 6, 2026
…3#1057) - Increase polling intervals (markets 8→12min, feeds 15→20min, crypto 8→12min) - Increase background tab hiddenMultiplier from 10→30 (polls 3x less when hidden) - Double CDN s-maxage TTLs across all cache tiers in gateway - Add CDN-Cache-Control header for Cloudflare-specific longer edge caching - Add ETag generation + 304 Not Modified support in gateway (zero-byte revalidation) - Add CDN-Cache-Control to bootstrap endpoint - Add explicit SPA rewrite rule in vercel.json for CF proxy compatibility - Add Cache-Control headers for /map-styles/, /data/, /textures/ static paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces Vercel bandwidth and request costs through polling optimization, aggressive CDN caching, and ETag-based revalidation. Paired with Cloudflare Cache Rules configured on the dashboard.
Changes
hiddenMultiplier10→30 (hidden tabs poll 3x less)vercel.jsonnow has a catch-all rewrite toindex.htmlfor CF proxy compatibilityimmutableCache-Control for/map-styles/,/data/,/textures/Cloudflare Cache Rules (configured separately)
/sw.js,/,/index.html/assets/,/map-styles/,/data/,/textures//favico/Estimated impact
~$900/month reduction (70%) when combined with CF proxy on main domain
Test plan
ETagheader:curl -I https://api.worldmonitor.app/api/market/v1/list-market-quotes?symbols=AAPLcurl -H 'If-None-Match: "<etag>"' -I https://api.worldmonitor.app/api/market/v1/list-market-quotes?symbols=AAPLCDN-Cache-Controlheader present on API responses