title: Reducing outbound bandwidth costs for a file hosting site on Azure Storage?
body: <p>I'm currently running a file hosting site as a side project and I'm using Azure Storage to actually store and serve the files. The big issue for me is that I would like to be able to support relatively large files as well, which are really expensive to serve.</p>
  
  <p>According to the <a href="http://azure.microsoft.com/en-us/pricing/details/data-transfers/" rel="nofollow">pricing details</a> for Azure outbound data transfers, it'll cost me $0.087 per GB to serve files to the user. This is okay for things like images, but if the user stores something like a 1 GB video, it'll cost me around 9 cents per person who wants to download the file. Even if I try to monetize the service, I cannot see how I can reasonably sustain these costs if the service ever becomes popular.</p>
  
  <p>Does anyone have any suggestions or alternatives to reducing outbound data transfer costs? </p>
  
  <p>Edit: As I come across helpful ways to reduce my costs, I'll update the list below:</p>
  
  <ul>
  <li><p>Use a free CDN provider like Cloudflare. Specifically for me, I only enabled the CDN for files served through Azure Storage, because enabling it for my whole site would impose a 100MB file size upload restriction. One thing to note is that <a href="https://support.cloudflare.com/hc/en-us/articles/200172516-What-file-extensions-does-CloudFlare-cache-for-static-content-" rel="nofollow">Cloudflare doesn't cache everything</a>, so even though I'm covered for images, I'm still out of luck for many other media types that users might upload.</p></li>
  <li><p>Compress uploaded files so that not as much bandwidth is used on outbound transfers. </p></li>
  <li><p>If you're using cloud storage but host your website on a dedicated server with generous bandwidth, you can implement some kind of local cache and serve content directly from your cache, with the storage provider being a fallback on a cache miss. Unfortunately this isn't viable for me since I also host my site on Azure, and the outbound data transfer rates apply across their entire service stack.</p></li>
  </ul>