views:

21

answers:

1

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 those 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.

+1  A: 

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.

Nick Craver
That's exactly what I was looking for. I can't vote up your answer yet, but thanks anyway!
WVDominick
@WVDominick - Welcome!
Nick Craver