title: Azure Redis StackExchange.Redis ConnectionMultiplexer in ASP.net MVC
body: <p>I have read that in order to connect to Azure Redis cache is best to follow this practice: </p>
  
  <pre><code>private static ConnectionMultiplexer Connection { get { return LazyConnection.Value; } }
  
      private static readonly Lazy&lt;ConnectionMultiplexer&gt; LazyConnection =
          new Lazy&lt;ConnectionMultiplexer&gt;(
              () =&gt;
              {
                  return
                      ConnectionMultiplexer.Connect(connStinrg);
              });
  </code></pre>
  
  <p>And according to Azure Redis docs:</p>
  
  <blockquote>
    <p>The connection to the Azure Redis Cache is managed by the ConnectionMultiplexer class. This class is designed to be shared and reused throughout your client application, and does not need to be created on a per operation basis.</p>
  </blockquote>
  
  <p>So what is best practice for sharing ConnectionMultiplexer across my ASP.net MVC app ?
  Should it be called in Global.asax, or should I initialize it once per Controller, or smth. else ?</p>
  
  <p>Also I have service which is tasked to communicate with the app, so if I want to communicate with Redis inside the Service should I send instance of ConnectionMultiplexer to service from Controllers, or should I initialize it in all my services, or ?</p>
  
  <p>As you can see I'm a bit lost here, so please help ! </p>