| Location | User's browser | Server(s) hosting the application | Distributed network of servers geographically located | Distributed servers closer to the user than CDN, often with more compute capabilities | User's browser (client-side) |
| Data Stored | Static assets (images, CSS, JavaScript, fonts), API responses (sometimes) | Database query results, rendered HTML fragments, API responses, session data | Static assets (images, CSS, JavaScript, fonts), potentially dynamic content | Static assets, API responses, dynamic pages, computation results, security policies | User data, UI state, temporary data |
| Scope | Single user, single browser | Multiple users, across application servers | Multiple users, globally distributed | Users in a specific geographic area | Single user, single browser/tab |
| Invalidation | HTTP headers (e.g., Cache-Control, Expires, ETag), URL changes, manual cache clearing | Time-based expiration, event-driven invalidation (e.g., database changes), manual invalidation | Time-based expiration, cache busting (versioning), manual invalidation via CDN control panel | Invalidation techniques similar to CDN, also can invalidate via custom code or triggers | Manual clearing, session end (SessionStorage), time-based expiration (with custom code in LocalStorage) |
| Implementation | Configured through HTTP headers sent by the server | Requires server-side code to interact with caching system (e.g., Redis client) | Configuration within the CDN provider's control panel (e.g., AWS CloudFront, Cloudflare) | Configuration within the Edge Computing platform's control panel (e.g., AWS CloudFront Functions, Cloudflare Workers) | JavaScript code interacting with browser APIs |
| Advantages | - Fastest possible retrieval (local to the user) - Reduces server load - Improves website performance significantly - Works offline (if configured correctly) | - Faster retrieval than database or full computation - Reduced database load - Improved application responsiveness - Shared data across multiple application servers | - Reduced latency for users worldwide - Improved website performance - Handles high traffic volume - Offloads traffic from the origin server - Often includes security features (DDoS protection) | - Reduces latency for users in proximity - Improves performance due to closer proximity - Allows for computation closer to end-users | - Stores data locally on the user's computer - Fast access to data - Works offline - Simplifies state management |
| Disadvantages | - Limited storage space - Cache invalidation can be tricky - Requires proper HTTP header configuration - User can clear their cache | - Adds complexity to the application architecture - Requires managing the cache infrastructure - Data can become stale if invalidation is not handled properly - Increased cost for hardware/services | - Increased cost - Requires configuration and management - Data consistency can be an issue (propagation delays) - Potential security concerns (if not configured properly) | - Increased cost - Complex deployment - Requires managing edge infrastructure | - Security risks (sensitive data should not be stored) - Limited storage space - Data can be lost if the browser cache is cleared - Browser compatibility issues |
| Use Cases | - Static assets (images, CSS, JavaScript) - API responses that don't change frequently - Content that can be served even when the user is offline | - Database query results - Frequently accessed data - User session data - Rendered HTML fragments - API responses - Computationally expensive operations | - Websites with a global audience - High-traffic websites - Streaming media - Static content distribution | - Compute intensive operations at the edge - Complex custom logic execution at the edge - Security policies enforcement closer to end-users | - User preferences - UI state - Shopping cart data - Offline data storage - API token Storage |
| Example Technologies | Browser built-in cache, HTTP Headers (Cache-Control, Expires, ETag) | Redis, Memcached, Apache Ignite | AWS CloudFront, Cloudflare, Akamai, Azure CDN | AWS CloudFront Functions, Cloudflare Workers, Fastly | LocalStorage, SessionStorage, IndexedDB (for more structured data) |
| Data Size | Small to medium | Medium to large | Large | Medium to large | Small to medium |