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
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
Nuget package please ;-)
As you wish :)
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
Nice
Awesome