As of this morning, the Typo trunk requires Rails 0.14.2. I ran
rails . and then spent a couple hours cleaning up
environment.rb, and then updated all of the tests to work without instantiated fixtures. As advertised, this makes tests run quite a bit quicker; since Typo’s test suite had been flirting with the 5 minute mark on my laptop, anything that we can do to speed up tests is welcome.
Now that we’re safely requiring 0.14.x versions of Rails, I’ve started adding
session :off all over the place. My
sessions table for scottstuff.net has around 70,000 sessions in it right now, and I doubt that more then 15 or 20 of them were ever useful. We use sessions for user authentication, but that really only matters for admin pages plus a few other cases, like comment posting. In essence, any page that can be cached will never need access to a session. So, I made a little change to the Article controller. Instead of
class ArticlesController < ApplicationController caches_page :index, :read, :permalink, :category, :find_by_date, :archives, :view_page, :tag ... end
I’m now using
class ArticlesController < ApplicationController cached_pages = [:index, :read, :permalink, :category, :find_by_date, :archives, :view_page, :tag] caches_page *cached_pages session :off, :only => cached_pages ... end
This is a really common pattern, because pages that can use the page cache really shouldn’t depend on the session in any way. If I was doing this in more then one place, I’d probably want to extract it into a nice little plugin, but I’m just not feeling the motivation right now.