Caching
9 articles on Caching, each a problem from production engineering work and how it was solved.
-
Don't cache failures in Next.js 16 "use cache": throw, catch outside
A fallback returned from a "use cache" function is cached like real data. Let the cached function throw and catch the error in an uncached wrapper.
-
Why a Drupal Views upcoming events list keeps showing past events
Tag caching never expires a date-filtered View, because nothing is saved when time passes. Filter on end date and give the list a time-based cache.
-
GraphQL Compose drops text field cache tags: how to keep them
Add each text item's processed property as a cacheable dependency in hook_graphql_compose_field_results_alter, and version image URLs by file changed time.
-
Stop OpenSearch .NET client failures caching as empty results
OpenSearch.Client returns IsValid false instead of throwing, so check it, throw, and let the error reach the caller before any cache stores an empty result.
-
Purge Fastly after Next.js 16 revalidation, not before
Purge the CDN inside after(), once revalidatePath has run, and purge again a few seconds later so a stale page served mid-rebuild is not kept.
-
Capping the Next.js 16 image cache with maximumDiskCacheSize
Set images.maximumDiskCacheSize in Next.js 16 and the optimiser evicts least-recently-used images itself, so you can delete a cron or start-up prune.
-
A Next.js 16 Redis cacheHandler that fails fast when Redis is down
Connect lazily, key by build ID and set short ioredis timeouts so a Redis outage becomes a cache miss in a Next.js 16 cacheHandler.
-
Keep Next.js .next/cache when restoring a build on a persistent volume
If a start script wipes .next to restore a build, exclude the cache folder or every deploy throws away the fetch and image caches.
-
Making Next.js 16 tag revalidation work across several instances
Why revalidateTag only reaches one process by default in Next.js 16, and how a shared Redis tag store fixes it for both cache layers.