Jjasmineparkinjas-blogs.hashnode.dev·2d ago · 7 min readA 4% cache hit rate was costing us money. Here is the arithmetic I should have run first. We turned on prompt caching for our document-QA service and the invoice went up. Not dramatically. About 5%. Enough that I assumed it was traffic growth for the first two weeks, and it was not. This p00
AYAkash Yadavinblog.akashy.com.np·4d ago · 9 min readThe Ultimate Guide to Next.js Caching (Part 2): Cache Invalidation, SWR, React Query & Real Production ArchitectureThis is Part 2 of my Next.js Caching series. In Part 1, we covered Browser Cache, CDN, Router Cache, Full Route Cache, Data Cache, unstable_cache, and use cache. Previously... We learned that a requ10
AYAkash Yadavinblog.akashy.com.np·4d ago · 5 min readThe Ultimate Guide to Next.js Caching (Part 1): Browser Cache, CDN, Data Cache & unstable_cacheWhen someone opens your website, does Next.js immediately query your database? Not always. A request may pass through multiple cache layers before your database is even touched. The more requests serv00
DADaniel Anthony Romitelli Jrincraftedbydaniel.hashnode.dev·5d ago · 4 min readA Cache Key Is an Equivalence RelationA retry should not become a new creative decision. When a video job fails halfway through and runs again, the user still asked for the same scene. If a timestamp or retry count changes the lookup, the00
ASAman Singhinamanksinghin.hashnode.dev·Jul 24 · 7 min readRedis Caching Best Practices and PitfallsThe caching module covered the patterns and their failure modes one at a time. This article pulls them into a practical set of habits and warnings, the things experienced teams do by default and the m00
ASAman Singhinamanksinghin.hashnode.dev·Jul 24 · 7 min readPreventing Cache Stampede with RedisA cache stampede is one of those failures that stays hidden until traffic is high, then takes down your database at the worst possible moment. A popular cached key expires, and in the brief instant be00
ASAman Singhinamanksinghin.hashnode.dev·Jul 24 · 7 min readCache Invalidation Strategies with RedisThere's an old joke that there are only two hard problems in computer science: cache invalidation and naming things. The joke endures because it's true. Caching is easy to add and hard to keep correct00
ASAman Singhinamanksinghin.hashnode.dev·Jul 24 · 7 min readRefresh-Ahead Caching with RedisEvery cache pattern so far accepts that cache misses happen: a key expires, a request misses, and someone pays the cost of reloading from the database. Refresh-ahead attacks that directly. Instead of 00
ASAman Singhinamanksinghin.hashnode.dev·Jul 24 · 6 min readWrite-Behind (Write-Back) Caching with RedisWrite-through keeps the cache and database consistent by writing to both synchronously, which makes writes as slow as the database. Write-behind takes the opposite bet: write to the cache immediately,00
ASAman Singhinamanksinghin.hashnode.dev·Jul 24 · 7 min readRead-Through and Write-Through Caching with RedisCache-aside puts the caching logic in your application. Read-through and write-through move it into the cache layer itself, so the application talks to the cache as if it were the database and the cac00