What is the default serialization used by the ASP.net HttpRuntime.Cache

后端 未结 3 1895
予麋鹿
予麋鹿 2020-12-10 17:04

Just wondering if anyone knows definitively what the default serialization used by the ASP.net HttpRuntime.Cache is? Is it Binary, XML, something else?

I ask because

3条回答
  •  渐次进展
    2020-12-10 18:00

    Caches in general don't serialize or otherwise clone the objects you put in them. They just associate a key with the object you pass in. And since Lists are reference types, any changes you make to the list will be visible when the key is used to retrieve from the cache. So my guess is that you're removing items from the list after you insert it. This is why the clone on insert resolved it.

提交回复
热议问题