title: Resizing / caching JPEG images on Azure
body: <p>I have a website written in .NET 4.5 / MVC 4 that allows users to upload images, among other things. These images can be displayed throughout the site in a variety of sizes. Currently, the way this works is as follows:</p>
  
  <ul>
  <li>The image is uploaded and re-sized in memory to a max width of 640px (the largest the site will display).</li>
  <li>The resized image is saved to disk at /assets/photos/source/{id}-{timestamphash}.jpg.</li>
  <li>When a request for the image in various sizes comes through, I get the filename by combining {id}-{hash} where {hash} is the hash of a combination of ids, height, width and some other information I need to get the image.</li>
  <li>If that image exists in /assets/photos/cache, I simply return it, otherwise I create it in memory using the source image and then save it to the cache directory.</li>
  </ul>
  
  <p>I like this approach because it happens quickly and it all happens in-memory or via disk retrieval.</p>
  
  <p>I'd like to eventually move my site to Azure. How would a workflow like this happen in Azure given that all of my images would be stored as blobs? Is it still efficient to use a re-sizing/caching strategy like this or are there other alternatives? Wouldn't you incur network latency as the image is uploaded to Azure from the server where today, it just gets saved to disk which is obviously a lot faster? </p>
  
  <p>Just looking for some direction on how to migrate a workflow like this to something workable and scalable with Azure.</p>