Closed brotherhorse closed 2 months ago
How to set BrotliCompressor(var compress)?
MyCode:
_fusionCache = new FusionCache(
new FusionCacheOptions
{
DefaultEntryOptions = new FusionCacheEntryOptions(TimeSpan.FromSeconds(absoluteExpiration))
});
var compress = new BrotliCompressor();
var options = new MemoryPackSerializerOptions();
var serializer = new FusionCacheCysharpMemoryPackSerializer(options);
//add DistributedCach
_fusionCache.SetupDistributedCache(ocs.DistributedCache, serializer);
//add Backplane
_fusionCache.SetupBackplane(ocs.Create(_channel));
@jodydonetti
Yeah @brotherhorse I saw it, but it was 2am here in Italy and I have a daily job. Will get back to you as soon as I can.
Btw, have you tried this:
I think you can mark your classes with some attributes and it should work.
?
Hi, I've had some time to look at this. It seems like currently it's not possible to use the BrotliCompressor directly.
Separately I'm working on compression in general, not just Brotli for MemoryPack, but it will need some more time, so don't wait for it soon.
I may have a temporary solution for you, but I need a little bit more time.
Sorry to disturb your rest. Thank you very much for your reply. As Redis requires compressed storage to save space, I can temporarily use CompressLZ4. Thank you again.
Sorry to disturb your rest.
No disturb at all! It's just that I was not able to answer earlier 🙂
Thank you very much for your reply. As Redis requires compressed storage to save space, I can temporarily use CompressLZ4. Thank you again.
You're welcome, I'll update you in the future when compression may become a native, full-fledged feature of FusionCache.
Best.
Hi @brotherhorse , yes MemoryPack supports Brotli compression, see here.
I think you can mark your classes with some attributes and it should work.
Hope this helps, let me know if it worked.