CDN Caching Improvements for Better App Performance
Article Summary
AWS Amplify just shipped CDN caching improvements that delivered a 98% reduction in response times for static assets. Cookie handling was the culprit.
AWS Amplify Hosting rolled out major caching optimizations that fundamentally change how cookies interact with CDN cache keys. The team also enabled Brotli compression, added CloudFront header forwarding, and unlocked Next.js i18n support natively.
Key Takeaways
- Removing cookies from cache keys achieved 99.99% cache hit rate in benchmarks
- Real world example: Amplify docs site now maintains 90%+ cache hit ratio
- New CloudFront headers enable device detection and geo-targeting use cases
- Next.js i18n now works natively via accept-language header forwarding
- Brotli compression enabled automatically for all apps
Critical Insight
By excluding Google Analytics cookies from cache keys, Amplify reduced p95 response times by 98% and pushed cache hit rates above 99%.