[MTOS-dev] MT 4.15 Beta now available

Byrne Reese byrne at sixapart.com
Thu Apr 10 14:50:11 PDT 2008


FYI -- They key specified is still on a per-blog basis. At least that is the
intention.


On 4/7/08 2:26 PM, "Reed A. Cartwright" <reed at scit.us> wrote:

> Byrne Reese wrote:
>> It can. That is what the key attribute it for so that you can define what
>> properties a module hinges on WRT caching.
>> 
>> I believe this is discussed in the documentation.
> 
> Well you shouldn't have to repeat attributes like so
> 
> <mt:Include module="Xomment" xmode="quote" key="quote"/>
> 
> I guess you could just test 'key', but relying on keys too much is going
> to cause collisions between different blogs and different variable
> contexts.  As far as I can tell, when reading the code, key is a global
> variable, not a per-blog variable, so multi-blog setups can run into
> problems if they use the same key for different things.
> 
> I'm proposing that the default key be autogenerated based on the
> variable context.  Right now it does this:
> 
> 'blog::' . $blog_id . '::template_' . $type . '::' . $tmpl_name;
> 
> I think it would be helpful if it did this:
> 
> 'blog::' . $blog_id . '::template_' . $type . '::' . $tmpl_name .
> '?' . join('&', map { "$_=$marg{$_}" } keys(%marg));
> 
> Where %marg is a hash consisting of the template arguments and/or
> variables.  If string size is an issue, then it can be hashed.
> 
> This way context is automatically included in the cache key, making it
> smarter.
> 



More information about the MTOS-dev mailing list