$m->cache_self should still work if you call other components.

On Jun 9, 2010, at 4:53 PM, tech_list wrote:

> I'm not sure, but if I change the loop to :
>
> % for my $scr (@scripts) {
>       <% $scr %> ( was <& $scr &>)
> % }
>
> It caches correctly.  Can cache not work if other components are  
> called?
>
> On Jun 9, 2010, at 6:06 PM, Jonathan Swartz wrote:
>
>> What does that have to do with caching?
>>
>> On Jun 9, 2010, at 3:02 PM, tech_list wrote:
>>
>>> OK, I found where it breaks.  I'm basically concatenating all my  
>>> required JS files into 1:
>>> <%init>
>>> my @scripts=qw (
>>> /js/prototype.js
>>> /js/scriptaculous/scriptaculous.js
>>> /js/scriptaculous/effects.js
>>> /js/scriptaculous/controls.js
>>> /js/scriptaculous/dragdrop.js
>>> /js/scriptaculous/dragdropextra.js
>>> /js/scriptaculous/builder.js
>>>
>>> /js/scriptaculous/slider.js
>>>
>>> /js/lp/livepipe.js
>>> /js/lp/hotkey.js
>>> /js/lp/scrollbar.js
>>> /js/lp/window.js
>>> /js/lp/tabs.js
>>>
>>>
>>> /js/flotrd/flotr.js
>>> /js/ttp_files_proto/table.js
>>> /js/ttp_files_proto/dt_parser.js
>>>
>>> /js/flotrd/base64.js
>>> /js/flotrd/canvas2image.js
>>> /js/flotrd/canvastext.js
>>>
>>> /js/tablekit.js
>>> );
>>> </%init>
>>> % for my $scr (@scripts) {
>>>     <& $scr &>
>>> % }
>>>
>>> How can I proceed?
>>>
>>> On Jun 9, 2010, at 4:51 PM, Jonathan Swartz wrote:
>>>
>>>> Now slowly change your working example into your non-working  
>>>> example, one step at a time, until it breaks, at which point you  
>>>> should be able to pinpoint what's broken.
>>>>
>>>> On Jun 9, 2010, at 2:41 PM, tech_list wrote:
>>>>
>>>>> OK that seems to work:
>>>>>
>>>>> <%attr>
>>>>> ajax => 1
>>>>> </%attr>
>>>>> <%init>
>>>>> my $result = $m->cache->get('test_key');
>>>>> if (!defined($result)) {
>>>>>   $result=time();
>>>>>   $m->cache->set('test_key', $result);
>>>>> }
>>>>> # return if $m->cache_self(key => 'ljs-loadablejs' .  
>>>>> $session{username} . $session{userType}, expires_in => '3  
>>>>> hours' );
>>>>>
>>>>> </%init>
>>>>> <pre>
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> REAL:     <% time() %>
>>>>> CACHED: <% $result %>
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> </pre>
>>>>>
>>>>>
>>>>>
>>>>> Now what?
>>>>>
>>>>>
>>>>> On Jun 9, 2010, at 4:33 PM, Jonathan Swartz wrote:
>>>>>
>>>>>> Try reducing your example to a more minimal one. e.g. Use  
>>>>>> regular $m->cache instead of $m->cache_self, and try just  
>>>>>> caching a single static key and value to see if that works.  
>>>>>> Also try dumping the contents of $m->cache.
>>>>>>
>>>>>> On Jun 9, 2010, at 1:26 PM, tech_list wrote:
>>>>>>
>>>>>>> I can't seem to get cache to work.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> example component:
>>>>>>>
>>>>>>> <%attr>
>>>>>>> ajax => 1
>>>>>>> </%attr>
>>>>>>> <%init>
>>>>>>>
>>>>>>>
>>>>>>> return if $m->cache_self(key => 'ljs-loadablejs' .  
>>>>>>> $session{username} . $session{userType}, expires_in => '3  
>>>>>>> hours' );
>>>>>>>
>>>>>>> </%init>
>>>>>>> <pre>
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> ================================================================
>>>>>>> <% time() %>
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> = 
>>>>>>> ================================================================
>>>>>>> </pre>
>>>>>>>
>>>>>>>
>>>>>>> from httpd:
>>>>>>>
>>>>>>> PerlSetVar MasonDataDir /var/spool/mason/[site].com
>>>>>>>         PerlAddVar      MasonDataCacheApi chi
>>>>>>>         PerlAddVar      MasonDataCacheDefaults "driver => FastMmap"
>>>>>>> #PerlSetVar MasonCodeCacheMaxSize 0
>>>>>>>
>>>>>>> Each time it gives me the current time instead of the cached  
>>>>>>> verison
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>>>>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>>>>>> lucky parental unit.  See the prize list and enter to win:
>>>>>>> http://p.sf.net/sfu/thinkgeek-promo
>>>>>>> _______________________________________________
>>>>>>> Mason-users mailing list
>>>>>>> Mason-users@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/mason-users
>>>>>>
>>>>>
>>>>
>>>
>>
>


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to