caching - WebApi - Redis cache vs Output cache -
i have been studying redis (no experience @ - studied theory), , after doing research, found out being used cache. e.g. stackoverfolow self.
my question is, if have asp.net webapi service, , use output caching @ webapi level cache responses, storing kind of key/value (request/response) in server's memory deliver cached responses.
now redis in memory database, how me substitute webapi's output caching redis cache?
is there advantage?
i tried go through answer redis-cache-vs-using-memory-directyly, guess didn't got key line in answer:
"basically, if need application scale on several nodes sharing same data, redis (or other remote key/value store) required."
i storing kind of key/value (request/response) in server's memory deliver cached responses.
this means after server restart, server have rebuild cache . won't case redis. 1 advantage of redis on homemade in-memory solution persistence (only if that's issue , did not planned write persistence yourself).
then instead of coding own expiring mechanism, can use redis expire
or command expireat
or specifying expire timestamp when putting api output string cache setex
.
if need application scale on several nodes sharing same data
what means if have multiple instances of same api servers, putting cache redis allow these servers share same cache, reducing, instance, memory consumption (1 cache instead of 3 in-memory cache), , on...
Comments
Post a Comment