Monday, 27 October 2008
Dev-Friendly Web Caching
Ryan Tomayko announces Rack::Cache, a HTTP cache for Ruby’s generic Web API;
The basic goal is standards-based HTTP caching that scales down to the early stages of a project, development environments, light to medium trafficked sites, stuff like that. HTTP’s caching model is wildly under-appreciated in the Ruby web app community and my hope is that making its benefits more accessible will lead to wider understanding and acceptance.
I commented and, of course, focused solely on one aspect of his announcement (performance) while missing the big picture—getting real HTTP caching into developers’ hands in as easy a fashion as possible.
As Ryan points out, this is absolutely crucial, because if they don’t consider it from the start, it can be really hard to tack caching on later (after the resources and their representations and identifiers have been baked).
At Yahoo!, I’ve spent a lot of time working on this problem from the other end; Squid. Even its most fervent admirers (yes, there are a few) will admit that Squid isn’t exactly developer-friendly; it’s aimed more at the sysadmin / network geek crowd. And while the best Web folks have a good understanding of that world (if they don’t come from it), this still leaves out the bulk of people who can benefit from HTTP caching.
Fixing this means packaging up, tweaking and documenting the hell out of Squid so that it’s easy for Yahoos to install and use (and some more of this may see the light of day eventually; after all, I hear that we’re becoming open).
However, the Y! use case is not typical, as Mark occasionally reminds me; most developers don’t need the massive scalability of the Web just yet, they’re more interested in getting past the first few milestones with very little time or money available. Ryan’s approach is a great way to offer them low-hanging scalability fruit, gently pushing them in the right direction, while giving them a nice migration path if more is needed.
Really great stuff—kudos again, Ryan! Now, if only it were in Python…