简体   繁体   中英

HttpContext.Current.Cache with load balancing?

We're trying to implement caching of data used to compile Web Api response data. Thus far, we've been using HttpContext.Current.Cache, but I haven't found any information on how to configure this on a load balancing scenario.

I'm looking to use something along the lines of State Services or SQL Server (similar to session)

Is this even the right library to use?

If you go with sticky sessions on your load balancer then you don't need to change anything in your application and you do have your load splitted. But you will miss on availability.
Otherwise, you can't use the in process cache anymore and need to go to an outside server like Memcached / Aerospike / Redis - which are basically in memory no sql databases. You can also use Sql Server for this, but I don't think it is the right tool for such a job, because with a cache you shouldn't worry with things like persistence.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM