开发者

How do you use zipped objects in cache?

开发者 https://www.devze.com 2022-12-20 03:25 出处:网络
If I have lots of objects that I want to cache how would I go about compressing that data? It will mostly be string data which may be relatively small, but if I end up having a ton of thos开发者_开发知

If I have lots of objects that I want to cache how would I go about compressing that data? It will mostly be string data which may be relatively small, but if I end up having a ton of thos开发者_开发知识库e in cache the size would add up. I have memory limits, but my CPU is only hitting 15% at peak. I think I heard that stackoverflow was doing something similar, but I'm not sure. I think it's a nice approach in theory, but I've not seen how it is done.


Hanselman posted this as part of his Weekly Source Code series a while back, including complete, well, source code.

The Weekly Source Code 35 - Zip Compressing ASP.NET Session and Cache State

The basicas are you GZip compress when setting, GZip uncompress when getting, simple enough to implement.

0

精彩评论

暂无评论...
验证码 换一张
取 消