Adrian
State of caching in EFCore 2025
Hi.
Sorry if the question is banal but I have application using EFCore with postgresql for data access.
In my situation whenever I do operation that touches user profile (read/write) I would like to cache the entire user for 10 minutes and then whenever I make changes also apply them to cache and actual db after that, refreshing the 10 minute cache...
I was wondering if there's elegant way of doing this 2025?
what im using is the IMemoryCache and since virtually every request starts with UserId/UserProfile I have a helper method to get that?
Is this the correct approach or there are some more automatic ways of setting this up 2025?
9 replies