title: Optimal settings for serving images with ImageProcessor AzureBlobCache
body: <p>I've been trying to understand the issues <a href="https://github.com/JimBobSquarePants/ImageProcessor/issues/161" rel="nofollow noreferrer">https://github.com/JimBobSquarePants/ImageProcessor/issues/161</a> and <a href="https://github.com/JimBobSquarePants/ImageProcessor/issues/178" rel="nofollow noreferrer">https://github.com/JimBobSquarePants/ImageProcessor/issues/178</a> discusses here.</p>
  
  <p>I have an environment where i have my regular site on <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> and i have a separate site for imageprocessor served from <a href="http://d.example.com" rel="nofollow noreferrer">http://d.example.com</a>.</p>
  
  <p>Then i have the Azure blob cache setup like this.</p>
  
  <pre><code>    &lt;setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=***********;AccountKey=************" /&gt;
      &lt;setting key="CachedBlobContainer" value="imgcache" /&gt;
      &lt;setting key="UseCachedContainerInUrl" value="false" /&gt;
      &lt;setting key="CachedCDNRoot" value="https://imgcdn.azureedge.net/" /&gt;
      &lt;setting key="SourceStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=**********;AccountKey=***************" /&gt;
      &lt;setting key="SourceBlobContainer" value="dist" /&gt;
      &lt;setting key="StreamCachedImage" value="false" /&gt;
  </code></pre>
  
  <p>It seems to work fine but i'm not sure about what is my optimal setting for the "StreamCachedImage" option.</p>
  
  <p>I did some tests locally and with StreamCachedImage set to false it do a redirect to the CDN and i get a 302 and then a 200 from the CDN, and chrome says it cached so just a few bytes is transferred.</p>
  
  <p>First: 
  <a href="https://i.stack.imgur.com/GIKQu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GIKQu.png" alt="enter image description here"></a></p>
  
  <p>Second:
  <a href="https://i.stack.imgur.com/wJ2IK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wJ2IK.png" alt="enter image description here"></a></p>
  
  <p>When i switch to StreamCachedImage true i do not get a redirect and only get a 200 but it seems like it always returns the full image to the client.</p>
  
  <p><a href="https://i.stack.imgur.com/dw6VT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dw6VT.png" alt="enter image description here"></a></p>
  
  <p>I should also add that on top of this we also run Cloudflare against both example.com and d.example.com</p>
  
  <p>But well, i basically would like to get some advice on how to set this up and to understand it fully.</p>