Re: Mason 2.0 thoughts

Dave Rolsky <[email protected]> Sat, 12 May 2007 23:39:15 -0500 (CDT)
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
On Sat, 12 May 2007, Jonathan Swartz wrote:

> That works for caching a whole page, which in my experience is rarely
> possible on a dynamic site. cache_self allows you to cache the output
> of an arbitrary component, such as a form menu or nav bar.
>
> That said, I would prefer to provide a replacement for cache_self
> that looks more like Rails' fragment caching (http://
> api.rubyonrails.org/classes/ActionController/Caching/Fragments.html).
> e.g.
>
>     <% Cache (... cache flags ...) { %>
>     ...
>     [a component or part of a component]
>     ...
>     <% } %>
>
> Of course this syntax doesn't work out of the box in Mason because
> Perl doesn't support Ruby-style blocks, and our <% %> doesn't have
> the right semantics. But you get the idea. I want it to be just as
> easy to cache a portion of a component as cache_self makes it to
> cache an entire component.

If only we had a syntax for this ...

  <&| Cache, ... cache flags ... &>

  [some component content]

  </&>

;)


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/