Caching places reusable data or results where they can be retrieved more efficiently than from their original source. The original source, often called the origin or system of record, normally remains authoritative. A cache might hold website images, database query results, application objects, or recently accessed file data. Its value comes from reuse: repeatedly reading the same information becomes faster or less expensive.
A cache hit occurs when the requested data is available and usable in the cache. A cache miss requires fetching the data from its source or computing it, often followed by storing it for subsequent requests. Hit ratio measures the proportion of requests served from the cache. A high hit ratio generally reduces source traffic, but performance also depends on object sizes, retrieval latency, and the overhead of looking up cached entries.
Cloud content delivery networks apply caching at edge locations distributed near users. For example, a user requesting a product image can receive a cached copy from a nearby edge location instead of retrieving it repeatedly from a distant application or storage origin. This reduces network travel time and origin requests. AWS edge locations support services such as Amazon CloudFront; they are not interchangeable with AWS Regions or Availability Zones, and they do not automatically cache every AWS workload.
Not every edge request is a cache hit. The requested object may be absent, expired, evicted, or configured not to be cached. The delivery service then retrieves it through its upstream path. Dynamic or personalized responses require particular care: caching a response under a key that does not distinguish users or relevant request attributes can expose one user's data to another. Cache policies must reflect the application's authorization and content variation requirements.
Hybrid storage uses the same principle in a different location. An on-premises gateway can retain frequently accessed cloud-backed file data on local disks. Applications continue using familiar file protocols while local cache hits avoid repeatedly downloading data across the wide-area network. Amazon S3 File Gateway, part of AWS Storage Gateway, provides NFS or SMB access to files stored as Amazon S3 objects and maintains a local cache. Writes are buffered locally and uploaded asynchronously, so monitoring upload progress and protecting local disks matter.
A local file cache does not imply that the complete dataset is available locally. Accessing uncached data requires connectivity to its backing storage, and disconnected operation is limited by cached content and gateway behavior. Also distinguish Storage Gateway cached volumes from stored volumes: cached volumes keep primary data in Amazon S3 with frequently accessed data cached locally, whereas stored volumes keep the complete primary volume locally and asynchronously back it up to AWS. These volume modes expose block storage, not file shares.
Freshness is a central trade-off. A time to live limits how long an entry is considered fresh, while invalidation explicitly removes or expires entries after a change. Neither approach should be assumed to provide immediate consistency across every cache. Versioned object names are useful for static assets because a new filename identifies new content without depending on immediate removal of the old copy.
Caches have finite capacity, so eviction policies remove entries to make room. Cold starts, mass expiration, or cache failure can suddenly increase load on the source; applications should tolerate misses and protect dependencies from request surges. Measure hit ratio, latency, evictions, source load, and total cost rather than assuming that a larger cache is always better. Finally, caching is not a backup strategy: cached copies may be incomplete, stale, or disposable, and pending writes require separate durability considerations.