public
Description: This plugin fix the broken caches_page from Rails
Clone URL: git://github.com/penso/caches_page_fix.git
name age message
file MIT-LICENSE Tue May 20 05:18:48 -0700 2008 fix license [Penso Fabien]
file README Tue May 20 05:20:03 -0700 2008 fix README [Penso Fabien]
file Rakefile Sun May 18 07:49:02 -0700 2008 init message [Penso Fabien]
file init.rb Tue May 20 05:04:52 -0700 2008 Ready for release? [Penso Fabien]
directory lib/ Sun May 25 04:05:20 -0700 2008 moved init of variables [Penso Fabien]
directory tasks/ Sun May 18 07:49:02 -0700 2008 init message [Penso Fabien]
directory test/ Tue May 20 05:16:42 -0700 2008 Works without breakign anything now [Penso Fabien]
README
CachesPageFix
=============

Rails caches_page is broken, it has RACE condition bugs and is not really
efficient. If you don't think so then maybe this plugin is not for you.

How broken ? Example : you have 3 mongrel processes, caches_page for
/controller/something and the static file does not exist yet. If you have 3
connections at the same time for that specific page, you'll end up having 3
mongrel processes for generating the exact same page...

This plugin creates a .lock so the other mongrel processes wait for the first
one to deliver the page (except if the .lock is too old, then it removes it and
start again).

Example
=======

There are 2 ways to use this cache, you can use them in your controller like :

class SiteController < ApplicationController
    smart_caches_page :index
end

Or you can activate it in the routes with a :cache => true parameter


Copyright (c) 2008 [Fabien Penso], released under the MIT license