title: How to enable LZ4 compression for messagepack content type in Asp.net Core Web API
body: <p>I'm trying to enable MessagePack content type on a .net Core Web API Project that I'm working on.</p>
  
  <p>After some research, Installed this <a href="https://www.nuget.org/packages/WebApiContrib.Core.Formatter.MessagePack/" rel="nofollow noreferrer">nuget</a> package and added below code in the startup file. Easy enough ! Now I can see msgpack content served through my APIs.</p>
  
  <pre class="lang-cs prettyprint-override"><code>services.AddMvc().AddMessagePackFormatters(c =&gt; 
  {
    c.FormatterResolver = ContractlessStandardResolver.Instance;
    c.SupportedContentTypes.Add("application/x-msgpack");
    c.SupportedExtensions.Add("mp");
  });
  </code></pre>
  
  <p>Now I would like to apply LZ4 compression on top of it to reduce the payload size as mentioned in <a href="https://github.com/neuecc/MessagePack-CSharp" rel="nofollow noreferrer">here</a>. And I couldn't find any nuget packages to add this functionality or figure out a way to plugin LZ4 compression. In few blogs, I've read that LZ4 compression is inbuilt in MessagePack. I couldn't understand what that means and there's very little documentation out there about this stuff.</p>
  
  <p>I'm new at this compression/de-compression stuff, so any help is appreciated.</p>
  
  <p>Thanks</p>