[rt-users] RT 3.0 Speed

Dean Kao nouveaux at lightconsulting.com
Wed Apr 23 18:45:19 EDT 2003


> 
> Have you considered using the mason caching api ?
> 
> Something like this in the autohandler should help :
> 
> <%init>
> return if $r->uri eq '/index.html'
>    && !keys %ARGS
>    && $m->cache_self(expire_in => '5 mins',key=> '/');
> 

That's exactly what I did.  This is a quick little hack
which has increased the speed of RT homepage significantly.
I'm thinking of investing some time into getting caching
integrated to commonly used functionalities of RT.  I'll
see how far I get into it.

Dean
-------------- next part --------------
36,39d35
<      $Tickets->ClearRestrictions;                                           
<      $Tickets->LimitStatus(VALUE => "open");                                
<      $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');            
<      my $open = $Tickets->Count();
41,44c37,53
<      $Tickets->ClearRestrictions;                                           
<      $Tickets->LimitStatus(VALUE => "new");
<      $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');            
<      my $new = $Tickets->Count();
---
>      my $new = $m->cache->get($queue->Name . 'new');
> 	 if (! defined($new)){
>      	$Tickets->ClearRestrictions;                                           
>      	$Tickets->LimitStatus(VALUE => "new");
>      	$Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');            
>      	$m->cache->set ($queue->Name . 'new', $Tickets->Count(), '5m');
> 	  	$new = $m->cache->get($queue->Name . 'new');
> 	 }
> 
>      my $open = $m->cache->get($queue->Name . 'open');
> 	 if (! defined($open)){
>      	$Tickets->ClearRestrictions;                                           
>      	$Tickets->LimitStatus(VALUE => "open");                                
>      	$Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');            
>      	$m->cache->set ($queue->Name . 'open',$Tickets->Count(), '5m');
> 	  	$open = $m->cache->get($queue->Name . 'open');
> 	 }


More information about the rt-users mailing list