This article explains how to use versioning and cache-control HTTP headers to optimize caching for Single Page Applications (SPAs) deployed through Amazon CloudFront and Amazon Simple Storage Service (Amazon S3).
- SPAs have conflicting requirements: low latency for users, instant deploys, and reliance on Cache-Control HTTP headers instead of cache invalidations
- Tiered TTLs (time-to-live) with the right cache strategy using HTTP headers can meet all these requirements
- Object versioning with CloudFront makes caching easy, but users must know when to switch to new filename
- HTTP conditional requests and ETags reduce revalidation time for cached files
















