cache
A store of earlier answers kept close to where they are needed so they can be reused instead of fetched or computed again.
In more detail
A cache is only correct if it knows how long an answer stays true and when to check again. Caches save time at the cost of possibly serving stale data.
Examples
Inventory plugins can cache host lists, and fact caching stores gathered facts between runs.In AWS: A fast, temporary copy of data kept close to where it is needed so it does not have to be fetched or calculated again.Suspense data fetching needs a cache so every render reads the same promise for the same resource; TanStack Query and SWR provide one.Related terms
- fact caching — Storing gathered facts between runs, so later plays can reuse them instead of collecting them again from every host.
- inventory plugin — A plugin that builds inventory from a source such as a cloud account, configured with a small YAML file rather than written as a program.
- HTTP cache — A store that keeps HTTP responses and reuses them for later requests, following the rules the server sends in Cache-Control.
- Cache-Control — The HTTP header that states the caching policy for a response, such as private, max-age=0 or no-store.
- freshness — Whether a cached response may still be used without asking the server: fresh means yes, stale means it must be checked or fetched again.
- ETag — A response header holding an opaque tag that names one exact version of a representation, such as ETag: "1".
- hit ratio — The share of requests a cache answers itself without going to the origin.
- cache invalidation — Marking cached copies as out of date, or deleting them, when the real data changes so the next read fetches fresh data.
- TTL — How long a stored item, such as a session, token or cache entry, stays valid before it expires.
- cache aside — A caching strategy where the application checks the cache, and on a miss reads the database and stores the result itself.
- origin server — The server that actually holds the content or runs the application, as opposed to a proxy or cache in front of it.
- stateless — Describes a component or service that keeps no data from one request to the next, so each request carries everything needed to handle it.
- latency — The time between asking for something and getting the answer back.
- Cache Storage API — A browser storage API that saves pairs of Request and Response objects in named caches, usually managed by a service worker.
- cache-first strategy — A caching strategy that answers from the cache when possible and only goes to the network, then caches the result, on a miss.
- build cache — Saved results of earlier build steps that a build tool, such as Docker, reuses when nothing a step depends on has changed.
- two-tier cache — A cache with a small, very fast local layer inside each server process (L1) in front of a larger shared layer such as Redis (L2).
- Redis — A very fast in-memory data store used for shared caches, rate-limit counters, session data and pub/sub messaging.
- cache key — The name a cache entry is saved and looked up under, usually built from the operating system and a hash of the lock file.
- request deduplication — Making identical requests that happen at the same time share one network call instead of each sending their own.
- memoization — Remembering the result of a calculation for given inputs and reusing it when the same inputs come again, instead of recalculating.
Taught in
- Tokens And The Context Window — AI Engineering: LLM Apps, RAG & Agents
- Cost, Latency And Caching — AI Engineering: LLM Apps, RAG & Agents
- Reasoning Techniques — AI Engineering: LLM Apps, RAG & Agents
- Memory And Compaction — AI Engineering: LLM Apps, RAG & Agents
- How RAG Works And When To Use It — AI Engineering: LLM Apps, RAG & Agents
- Function Calling — AI Engineering: LLM Apps, RAG & Agents
- Build An MCP Server — AI Engineering: LLM Apps, RAG & Agents
- Connect An Agent To MCP — AI Engineering: LLM Apps, RAG & Agents
- Threat-Model An LLM App — AI Engineering: LLM Apps, RAG & Agents
- Tracing And Monitoring — AI Engineering: LLM Apps, RAG & Agents
- Capstone: The Tasks Assistant — AI Engineering: LLM Apps, RAG & Agents
- Dynamic Inventory — Ansible Configuration Management at Scale
- Performance, Forks And Best Practices — Ansible Configuration Management at Scale
- Caching And Conditional Requests — Modern API Architecture: REST, GraphQL & gRPC
- Partial Responses — Modern API Architecture: REST, GraphQL & gRPC
- Performance Optimization — Modern API Architecture: REST, GraphQL & gRPC
- The Night Larder Could Not Buy Servers Fast Enough — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Ten Findings, Six Pillars — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Which Zone, Which Journey? — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- Nine Jobs, Not Nine Servers — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- One Database Doing Five Jobs — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- The Public Subnet That Was Not — AWS Certified Cloud Practitioner (CLF-C02) Exam Prep
- The Morning An Availability Zone Went Dark — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Who Signs In: Identity Center, STS And Cognito — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Edge: WAF, Shield, CloudFront And GuardDuty — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Serverless And Container Patterns: Where The Limits Bite — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Databases That Survive: Standbys, Replicas And Global Tables — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Route 53 Routing: Where Does A Fan In Lagos Land? — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Compute Performance: Families, Placement And Lambda Memory — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Database Performance: Caches, Proxies And Capacity Units — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Network Performance: Peering, Transit Gateway And The Edge — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Performance Clinic: Five Slow Systems, Five Fixes — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Network Cost: NAT Gateways, Zones And Data Out — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Full Mock And Your Review Plan — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Elasticity and Scale — Cloud Infrastructure & Hyperscaler Architecture
- Critical Rendering Path: Preload, Prefetch And Scripts — Frontend Architecture & Web Platform
- Service Worker Lifecycle: Installation, Activation And Update — Frontend Architecture & Web Platform
- Cache Storage API: Offline Strategies And Cache-First Patterns — Frontend Architecture & Web Platform
- The Fetch API: Streaming Responses, HTTP Caching And Keepalive — Frontend Architecture & Web Platform
- Unified Build Pipelines: Caching & Dependency Graphs — Production Full-Stack Engineering
- Type-Safe Client Generation: Orval & Automated SDKs — Production Full-Stack Engineering
- Optimistic UI Architecture: Cache & Rollback Protocols — Production Full-Stack Engineering
- Distributed Cache Invalidation: Redis & Tagged Purging — Production Full-Stack Engineering
- Resilience Engineering: Circuit Breakers & Retries — Production Full-Stack Engineering
- Keys In Depth: Identity Preservation And Identity Resetting — React 19 & Modern Component Architecture
- The use() Hook: Reading Promises And Context Directly — React 19 & Modern Component Architecture
- Suspense Architecture: Promises, Fallbacks, And Co-ordination — React 19 & Modern Component Architecture
- Code-Splitting with React.lazy: Dynamic Imports And Chunks — React 19 & Modern Component Architecture
- Client-Side Data Fetching Architectures with Suspense — React 19 & Modern Component Architecture
- React.memo, useMemo, And useCallback: Optimization Costs — React 19 & Modern Component Architecture
- The React Compiler: Automated Memoization Under The Hood — React 19 & Modern Component Architecture
- Requirements: The Constraints That Shape The System — Scalable System Design & Distributed Architecture
- Back Of The Envelope Estimation: Traffic And Throughput — Scalable System Design & Distributed Architecture
- Back Of The Envelope Estimation: Storage And Bandwidth — Scalable System Design & Distributed Architecture
- Latency Numbers Every Engineer Should Know — Scalable System Design & Distributed Architecture
- The Storage Decision: Relational Versus Document — Scalable System Design & Distributed Architecture
- The Storage Decision: Key Value, Search And Blob — Scalable System Design & Distributed Architecture
- Consistency, And The Truth About CAP — Scalable System Design & Distributed Architecture
- Eventual Consistency And What It Costs A Product — Scalable System Design & Distributed Architecture
- Caching Strategies And Topology — Scalable System Design & Distributed Architecture
- Cache Invalidation And The Three Hard Cases — Scalable System Design & Distributed Architecture
- Load Balancing And The Failure Modes It Introduces — Scalable System Design & Distributed Architecture
- Circuit Breakers — Scalable System Design & Distributed Architecture
- Observability As A Design Input — Scalable System Design & Distributed Architecture
- Capacity Planning As A Design Input — Scalable System Design & Distributed Architecture
- Worked Design One: Ticket Booking, Correctness First — Scalable System Design & Distributed Architecture
- Worked Design One: Scaling The Ticket Booking System — Scalable System Design & Distributed Architecture
- Worked Design Three: A Metrics Ingestion Pipeline — Scalable System Design & Distributed Architecture
- Worked Design Three: Scaling The Metrics Pipeline — Scalable System Design & Distributed Architecture
- Facts And Magic Variables: Let Each Node Describe Itself — RHCE in Ansible (EX294): Automate Red Hat Systems
- Packages And Repositories: yum_repository And dnf — RHCE in Ansible (EX294): Automate Red Hat Systems
References
- MDN: HTTP caching
- RFC 9111: HTTP Caching
- MDN Web Docs glossary: Cache
- Azure Architecture Center: Caching guidance
- Amazon Builders' Library: Caching challenges and strategies
- AWS: What is caching?
- React reference: use, caching promises