How can I specify Memcached options to compress the cached data with C#.Net?

1.5k Views Asked by At

I have ASP.Net project and I'm using Memcached for data and session caching. I also need to use the compress options of Memcached. I'd appreciate that if you can share your comments with me! I have found some sites but they don't have any c#.Net code samples.

1

There are 1 best solutions below

0
On

According to this comparison of memcached clients, the Enyim doesn't provide built in compression support.

The beitmemcached library however has. The Feature Description says it's automatically compressing all objects exceeding a certain threshhold.

Compression

The client also supports compression for storing large objects. It uses the built-in DeflateStream compression, which compresses data into the Deflate format. If the bytearray that is to be stored is larger than the value specified in the property CompressionThreshold, the data will be compressed before stored in the memcached servers, and automatically decompressed when retrived. The default value of CompressionThreshold is 128 kB.