Re: Mason 2.0 thoughts

Jonathan Swartz <[email protected]> Sun, 13 May 2007 16:45:27 -0700
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
> On 5/13/07 12:30 AM, 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.
>
> Speaking of cache_self, here's a feature that I've implemented  
> enough times
> to wish it was built-in: cache expiration on the <unit time>.  For  
> example,
> a cache that expires at 00:00 each day.  (That's something very  
> different
> than an expiration time of 24 hours.)
>

Ironically, the Mason 1.0-and-before cache syntax had this -  
expire_next=>'day' and expire_next=>'hour' - and is still actually  
supported with data_cache_api => '1.0'. We should bring into the new  
cache API. Ideally we'd put it in Cache::Cache itself as it's a  
generally useful feature.

> A second request:
>
>     <% STUFF |myescape %>
>
> where a piece of my code gets passed STUFF, either as a string or as a
> "live" snippet of Perl.  Right now, I have to do:
>
>     <% 'STUFF' |myescape %>
>
> and the quotes annoy me, as does the need to eval manually.
>

Ah, so whereas the current escape flag subroutines get passed the  
result of STUFF, you'd like it to pass STUFF as a code reference?

This could be part of the unification of pipe syntax and CWC that  
Dave was talking about.

Of course, this would be unnecessary (and inefficient) for escape  
flags like |h, so we'd want to do the right thing depending on the  
escape flags.

Jon


-------------------------------------------------------------------------
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/