November Happy Hour will be moved to Thursday December 5th.

Dan Matthews
Sep 22, 2011
  5006
(3 votes)

Using Dropbox to avoid bandwidth burn

The cloud is great. You can store stuff in it, even run apps in it. And EPiServer can make good use of it too. One thing you can do is store your files in the cloud and access them via a VPP. You can just use the cloud as a remote repository and still route the actual file streams through the server. Not an issue with small files and infrequent downloads, but with big files and frequent downloads, this will soon bloat your server bandwidth. As the cloud would typically be used for larger, more frequent downloads, a different solution might be a good idea, bypassing EPiServer for the actual download.

Of course, to work this way you need a cloud repository that exposes files, and one of those is Dropbox. What I’ve done is to write a VPP that exposes a Dropbox public folder, but when a file is requested it redirects to that file direct from Dropbox. It’s a bit of a hack, but it works fine and saves all the server bandwidth that grabbing a file would normally use.

The actual communication for pulling file and folder information between the VPP and Dropbox is done via the Dropbox REST API. I use the nice DropNet library to handle the actual REST calls and wrap the responses nicely for me. File summaries are supported and stored in the DDS. The implementation is read-only for now, but could be easily extended. For example, you could support moving/deleting through Dropbox API calls easily enough, and even do uploads. I simply didn't need them for the purpose I wrote this.

You can get the source yourself and read all about the module on epicode and, if you like it, feel free to implement some of the other features and commit it back Smile

Edit: I’ve been alerted that the Amazon S3 VPP actually uses a custom rewriter to rewrite the links on-the-fly if they are on the cloud server. That’s very elegant and I’m upset I didn’t think of it. Nice one guys Smile

Sep 22, 2011

Comments

smithsson68@gmail.com
smithsson68@gmail.com Sep 22, 2011 03:11 PM

Nuget package please ;-)

Sep 22, 2011 04:09 PM

As you wish :)

Frederik Vig
Frederik Vig Sep 23, 2011 12:13 PM

Hi Dan
We're actually hooking into the HTML Rewriter and updating the URLs to access directly from Amazon S3 or CloudFront instead of going through the server. If the users requests the file from the server we redirect them. So no file streams go through EPiServer.

Frederik

Mari Jørgensen
Mari Jørgensen Sep 23, 2011 12:26 PM

Nice

Sep 28, 2011 05:48 AM

Awesome

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog