views:

163

answers:

2

Does anyone have any experience in using compression on their cached data? I understand that stackoverflow is internally using this method.

What are the pros and cons?

And are there any gotchyas?

+1  A: 

you should try memcached. It's a distributed caching server that is easy to use and provides impressive compression capabilities.

Manu
Is memcached worth while if only using a single server?
Harry
+3  A: 

Scott Hanselman just created a Session wrapper class that can zip items before putting them into your cache/session/whatever. You may want to take a look!

http://www.hanselman.com/blog/TheWeeklySourceCode35ZipCompressingASPNETSessionAndCacheState.aspx

EndangeredMassa
Thanks for the link, great to compare implementations
Harry
Hanselman notes that you can get data expansion from the built-in DeflateStream (or GZipStream, whatever he used). As I have posted elsewhere, this is a known anomaly. https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=93930 You need a different stream to avoid it.
Cheeso