Testing TTFB Impact of Cloudflare Edge Caching
Project: VisaReadyNow
1. Hypothesis
Caching static HTML responses at the edge will reduce global TTFB from ~650ms to under 120ms without stale data issues.
2. Change Made
Configured Cache-Control headers with s-maxage=86400 and stale-while-revalidate for static project and guide pages.
3. Expected Result
TTFB drop to < 150ms across global test locations.
4. Actual Result
Average TTFB dropped to 85ms in US and 110ms in EU. Zero cache invalidation issues observed.
5. Conclusion & Takeaway
Edge caching eliminated server compute overhead on repeated requests, reducing TTFB by over 80%.
Data & Impact
US TTFB-87%
EU TTFB-85%
Detailed Notes & Context
Context & Setup
When serving content pages from an origin server, network latency to international visitors often dominated response time. By pushing response caching to edge nodes, pages are delivered directly from the visitor's nearest point of presence.
// Header configuration applied to edge handlers
export const revalidate = 86400 // 24 hours
Key Findings
- Origin server load decreased by 92% during synthetic traffic tests.
- First Contentful Paint (FCP) improved in direct correlation with the TTFB decrease.