Voxel Labs introduces mod_cdn

September 16th, 2008

posted by Dr. Kris Beevers

Something we have a lot of experience with at this point is helping VoxCAST customers modify their websites to take advantage of the CDN’s static content delivery. Depending on how forward-thinking a customer was when they first built their site, the process can be as simple as switching a DNS entry. Typically, though, it’s more like:

  1. Look through the HTML, PHP, Ruby, Python, or whatever else for links to static content;
  2. Painstakingly edit the code to re-point those links to a new hostname, like cdn.example.com;
  3. Potentially (depending on the application) relocate all the actual content to a different origin server (for some of our customers with TB of data, this has taken weeks); and
  4. Finally, turn on the CDN, point cdn.example.com at it, and hope you didn’t miss anything important.

In other words, turning up a CDN to serve your content can be a lot of work if you weren’t planning on it from the start.

Well, like all good engineers, at Voxel Labs we’re lazy. We don’t like to waste time doing boring stuff like poking through code looking for links to replace, and we’re pretty sure our customers share the sentiment. So we came up with mod_cdn, an Apache module that makes CDN-ifying a site ridiculously easy.

mod_cdn sits between content generation and delivery on an origin server. Just before content is delivered to an end user (or a CDN), mod_cdn can:

  • Use regexes to find links to static content in HTML and rewrite them to point to a CDN;
  • Automatically handle authentication for protected content;
  • Improve CDN cacheability by adjusting query strings; and
  • Make Apache behave as a proper origin, adding Expires headers and doing other preparation for delivering static content to a CDN.

We’ve heard some other CDNs provide Perl scripts that walk directory trees and replace URLs in HTML files. The big advantage mod_cdn has over an approach like this is its agnosticism to the method of content generation. You can generate your HTML dynamically using whatever backend you want, because mod_cdn acts to CDN-ify your site after content generation but before delivery.

We’ve decided to release mod_cdn as open source. Obviously it’s geared for now toward VoxCAST; we’re already deploying it internally as part of our Universal Transfer initiative. But mod_cdn is useful for other CDNs too, and we’re happy to accept patches (or even just suggestions!) and let the community tinker to its heart’s content.

We’ve already started thinking about mod_cdn’s next big feature: intelligent switching between CDN and non-CDN delivery. At Voxel we have a lot of managed hosting customers who occasionally get hit hard. Soon, mod_cdn will measure load on a customer’s webheads and overflow to VoxCAST or another CDN automagically.

We think mod_cdn is pretty neat, and it has the potential to save us and our customers a lot of time and money.

Check it out and let us know what you think!

Posted in General Posts, Press | 2 Comments »

2 Responses to “Voxel Labs introduces mod_cdn”


  1. Amazon’s Getting It Right With CDN | Voxel Blog Says:

    [...] want to submit patches to enable your CDN to work with our mod_cdn out of the box, we’d be pleased to have [...]


  2. Voxel Labs updates mod_cdn with new functionality | Voxel Blog Says:

    [...] Labs updates mod_cdn with new functionalityJanuary 12th, 2010posted by Reed LodenIt’s been a while since we last talked about Voxel Labs’s mod_cdn Apache module for easily interfacing an [...]


Leave a Reply

Make a Comment

Your Name

Email

Homepage

Comment