Monday, April 25, 2011

Compressing Memory Cache

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?

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

    Harry : Is memcached worth while if only using a single server?
  • 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

    Harry : Thanks for the link, great to compare implementations
    Cheeso : 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.

0 comments:

Post a Comment