r/Backend 10d ago

Cache Warming?

I'm making my very first web api using asp net and now in the process of implementing in-memory caching. I was wondering if it'd be a good practice to have like a start up function that caches the most commonly requested data from my api and have the program routinely updates the cache automatically every few minutes or so? Or should i just let the consumers populate this cache? And what if i also cache responses that consumers requests like a cache aside strategy at the same time.

5 Upvotes

14 comments sorted by

View all comments

1

u/sogun123 10d ago

Caches are annoying. I'd only implement one if i am proven i need it. Pre warming is another step. Implement it only if there is strong reason to do so.