Dan Matthews
Sep 22, 2011
  4891
(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
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024

Frontend Hosting for SaaS CMS Solutions

Introduction Now that CMS SaaS Core has gone into general availability, it is a good time to start discussing where to host the head. SaaS Core is...

Minesh Shah (Netcel) | Jul 20, 2024

Optimizely London Dev Meetup 11th July 2024

On 11th July 2024 in London Niteco and Netcel along with Optimizely ran the London Developer meetup. There was an great agenda of talks that we put...

Scott Reed | Jul 19, 2024