Skip to content
tezvyn:

Caching

59 bites tagged Caching — interview questions with model answers, and 60-second explainers.

React & Next.js2 min read

GET caching in Route Handlers and how to opt out

Tests App Router GET Route Handler caching and dynamic opt-outs. Hit: export const dynamic = 'force-dynamic', revalidate = 0, dynamic APIs like cookies(), and unstable_noStore(). Red flag: confusing this with Pages Router API routes, dynamic by default.

React & Next.js2 min read

How do you implement on-demand revalidation from a CMS webhook?

Tests Next.js cache invalidation and webhook security. Answer: secure Route Handler that calls revalidatePath or revalidateTag; next request rebuilds. Red flag: full redeploys, no secret check, or Server Component revalidate calls.

React & Next.js2 min read

Describe an ideal ISR scenario and configure it in a Server Component

This tests stale-while-revalidate tradeoffs. A strong answer picks a semi-static scenario like a product catalog, then covers the fetch revalidate option or segment-level config. A red flag is confusing ISR with SSR or adding useEffect to a Server Component.

React & Next.js2 min read

Server Component fetch vs. client-side SWR or React Query

Tests App Router cache boundaries and hydration costs. Strong answers weigh server TTFB and bundle savings against client interactivity, mutations, and background refetching. Red flag: defaulting to client fetching everywhere and ignoring waterfalls.

React & Next.js2 min read

Recommended App Router pattern to fetch shared data once for child routes

Tests App Router layout constraints and request deduplication. Answer: wrap the user fetch in React cache, call it from layout and child Server Components, and let Next.js deduplicate. Red flag: layout prop drilling or getServerSideProps.

Python & FastAPI2 min read

How does FastAPI cache dependencies within a single request?

Tests if you know FastAPI caches a dependency after the first call in a request and reuses it across the tree. A strong answer covers default use_cache=True, request-scoped lifetime, and disabling it.

Product Strategy2 min read

Propose a scalable entitlement architecture for complex rules

Tests separation of hot-path reads from async policy work. Great answers: edge-cache plan tokens; stream quota usage async; isolate rules in a microservice. Red flag: doing a DB lookup or sync quota check per request.

Growth & Experimentation2 min read

Design a highly available entitlements service with caching

This tests balancing read performance with consistency in access control. A strong answer proposes tiered caching with proactive invalidation, read-optimized hot paths, and event-sourced temporary grants.

Growth & Experimentation2 min read

How would you design a near real-time social proof notification system?

This tests low-latency event pipeline design with bounded load. A strong answer uses a fire-and-forget beacon, stream processor, and cache with TTL; it favors approximate counts and windowed aggregation.

Flutter & Dart2 min read

Implement an API caching layer with offline support and storage trade-offs

Use in-memory for hot data and disk for offline, pick Hive or SQLite by shape, and use TTL with a sync queue. Designing a tiered cache for speed and resilience. Ignoring invalidation or treating all data identically.

Docker & Kubernetes2 min read

Container Images Are Stacked Deltas

Images stack read-only layers like transparent sheets, one per Dockerfile step, topped by a thin writable layer. This enables cache reuse and fast pulls. The footgun: removing a file in a later layer hides but does not delete it; those bytes still ship.

Content & Copywriting2 min read

Display a dynamic uptime claim without hurting Core Web Vitals

Tests separation of data and rendering paths for dynamic claims. Pre-compute the metric in a background job, cache at the edge, and inject via SSR to avoid blocking the main thread. A red flag is synchronous DB lookups or CSR that delays interactivity.

Content & Copywriting2 min read

Caching and performance challenges in SSR with personalized copy

Segment-level cache keys, short TTLs with stale-while-revalidate, and edge personalization to protect origin. Cache efficiency versus segment personalization at scale. Per-user cache keys or disabling cache entirely.

Content & Copywriting2 min read

Design a highly scalable headless CMS architecture

Tests write-heavy authoring versus read-heavy delivery separation at scale. Strong answers outline dual-cluster isolation, event-driven invalidation, and CDN edge caching. Red flag: a monolithic service with only database query caching.

Vue, Angular & Svelte2 min read

ISR: Static Speed for Dynamic Content

Incremental Static Regeneration (ISR) gives users a fast, static page while regenerating it in the background. It's ideal for e-commerce catalogs or blogs that update periodically.

Vue, Angular & Svelte2 min read

TanStack Query: Managing Server State, Not Client State

TanStack Query manages asynchronous server state, not client-side UI state. It treats server data as a cached resource. Use it to fetch, cache, and update remote data automatically. The footgun is using it for synchronous client state like form inputs.

TypeScript & Web APIs2 min read

Cache API: Manual Control Over Network Responses

The Cache API is a key-value store for network requests you control directly, unlike the browser's automatic HTTP cache. Use it in service workers for offline support or to pre-cache app assets.

React & Next.js2 min read

Next.js Router Cache: Instant Client-Side Navigation

The Next.js Router Cache is a client-side, in-memory cache that makes navigation feel instant by storing the rendered UI of visited routes. It's why navigating with `<Link>` is fast. The footgun: it caches UI, not data, so stale content can appear.

React & Next.js2 min read

Next.js Extends `fetch` for Server-Side Caching

Next.js extends the standard `fetch` API to control server-side caching and revalidation. In Server Components, pass options like `next: { revalidate: 3600 }` or `tags` to manage how data is cached. This extension is server-only and ignored in browsers.

React & Next.js2 min read

Next.js Caching: When and How to Revalidate Data

Next.js aggressively caches data by default. Revalidation is how you tell it the data is stale, either after a set time or on-demand after a mutation. The footgun is forgetting `fetch` is cached; use `revalidatePath` or `revalidateTag` to bust the cache.

React & Next.js2 min read

RTK Query: Your Redux Data Fetching Layer

RTK Query treats server data as a cache, not global state, handling fetching and loading states for you. Use it to replace manual fetch logic and keep data fresh across components. Forgetting to call `setupListeners` disables automatic refetching.

React & Next.js2 min read

ISR: Static Speed with Dynamic Freshness

ISR offers the speed of a static site with the freshness of a server-rendered one. It serves a cached page, then regenerates it in the background after a set time, making it ideal for blogs or e-commerce sites.

MLOps & Infrastructure2 min read

Pipeline Step Caching: Don't Recompute What You Don't Have To

Pipeline step caching is memoization for your ML infrastructure, saving time and money by reusing previous results. It's used in MLOps pipelines when inputs and code haven't changed. The footgun: the cache is scoped to one pipeline and a timeout, not globally.

MLOps & Infrastructure2 min read

LLM Inference Caching: Pay for Computation Once

LLM inference caching reuses past computations to cut costs and latency. It avoids reprocessing shared system prompts or serves full answers for common queries without hitting the model. The footgun: semantic caches can return a "similar" but incorrect answer.

Get Caching bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.