[rt-users] Question on clearing mason cache

Mike Friedman mikef at ack.berkeley.edu
Thu May 10 18:40:45 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am I misunderstanding something, or is it the case that, if RT is running 
with mod_perl, the mason cache is automatically cleared on each apache 
restart, assuming I'm not running with 'DevelMode' on?  That's what the 
code in webmux.pl seems to be doing.

Over the years, I've seen many comments reminding someone to clear the 
mason cache in addition to restarting RT, when making certain kinds of 
changes.  But now I'm wondering about this, at least in a mod_perl 
environment.

I'm referring specifically to this code in webmux.pl:

    if ($ENV{'MOD_PERL'} && !$RT::DevelMode) {
        # Under static_source, we need to purge the component cache
        # each time we restart, so newer components may be reloaded.
        #
        # We can't do this in FastCGI or we'll blow away the component root
        # _every_ time a new server starts which happens every few hits.

        use File::Path qw( rmtree );
        use File::Glob qw( bsd_glob );
        my @files = bsd_glob("$RT::MasonDataDir/obj/*");
        rmtree([ @files ], 0, 1) if @files;
    }

Can I assume that restarting apache will, in fact, cause the mason cache 
to be cleared every time?  I am running with mod_perl and do have a 
'PerlRequire' statement that runs webmux.pl.

When I look at the timestamps on the members of var/mason_data/obj, 
they're always mostly very current, even if RT hasn't been started in 
quite a while. And I do have $DevelMode set to '0' in RT_SiteConfig.pm.
But this doesn't mean too much, since presumably things are being
cached all the time.  That's why I'm asking the question here.

This is RT 3.6.3, but webmux.pl looks similar in earlier versions I'm 
running as well.

Thanks for clarifying all this.

Mike

_________________________________________________________________________
Mike Friedman                        Information Services & Technology
mikef at ack.Berkeley.EDU               2484 Shattuck Avenue
1-510-642-1410                       University of California at Berkeley
http://socrates.berkeley.edu/~mikef  http://ist.berkeley.edu
_________________________________________________________________________

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRkOfca0bf1iNr4mCEQLZ1gCdHM7BvLu5uLJFOGkobvSnssy50Z4AoMqj
ZCzbqsc0DmB0tuQpsYNO67hJ
=pPMF
-----END PGP SIGNATURE-----



More information about the rt-users mailing list