Search code examples
asp.netazureazure-caching

Azure Co-Located-Cache max item size for session state


I have undestood that the maximum serialized size of an item in the Co Located Azure Shared Cache (preview) is 8mb. I am currently using the Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider to store my session state in the cache.

My question is if the session (all session key/values) is serialized as one item or is it each key by it self that can not exceed 8MB?

So if i have 10 keys with 1 mb of data each is it exceding the 8MB limit?

I know that you arent suppose to store that large objects in session (and I don´t 99% of the time) its just to know how some edge cases will behave in my application.


Solution

  • In my experience, what you say is correct. I've used the Microsoft report viewer control which puts a large amount of data into session with a guid key each time you run a new report and if I don't clean out these session keys I see this error.