How do you use zipped objects in cache?
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.
精彩评论