[typo] Rethinking Content Whiteboards
scott at sigkill.org
Thu Sep 28 13:42:10 EDT 2006
After watching my logs yesterday, I'm seriously considering ditching a
lot of the sweeper implementation and switching to something like
if Article, Page, or Settings changed -> sweep everything
elsif Comment or Trackback -> sweep page, add +60 minute trigger to
sweep everything if one doesn't already exist.
We should probably also add a 'if comment is published' in there
somewhere, because even spam comments are nuking my cache.
On 9/28/06, Piers Cawley <pdcawley at bofh.org.uk> wrote:
> At the moment we're holding whiteboards as a serialised field in
> contents table. Which was fine when we were also caching the HTML
> representations there too -- whiteboards generally got (re)generated
> during text formatting and got magically saved along with the html
> But now, the rendered html is managed by the controller and held in
> a different sort of cache, so the article doesn't get saved, so the
> whiteboard data gets thrown away. Which is not good.
> So, my thinking is add something like:
> class Whiteboard
> serialize :data
> def method_missing(:method, *args)
> method.to_s =~ /^(.*)(=?)$/
> key = $1
> is_assignment = !$2.blank?
> unless data.has_key? key
> return super(:method, *args)
> if is_assignment
> data[key] = *args
> And having a table definition like
> create_table :whiteboards do |t|
> t.column :name, :string
> t.column :data, :text
> The tricky part might be in getting a working acts_as_hash
> implementation, but that's a SMOP.
> Piers Cawley <pdcawley at bofh.org.uk>
> Typo-list mailing list
> Typo-list at rubyforge.org
More information about the Typo-list