Dear HTML::Mason community,

For reasons which, trust me, do make sense, the configuration of my
HTML::Mason-based web application sometimes changes in such a way that
Mason component root is switched to point to a version of my
application that has older component files.  In this situation,
Mason's component compiler rightly sees only that the compiler version
of the component is newer than the source, and therefore does not
recompile.  This can lead to terribly confusing situations where the
application is running a mix of old and new code.

It seems that a good way to ameliorate this problem is to have the
compiled-component cache deleted whenever the web-server (Apache2)
starts up.  I have searched the documentation and source code for a
setting that does this, but can't find one -- did I miss it, or is
there no such setting?

At the moment, I am "solving" this problem using a
PerlPostConfigRequire directive in my Apache2 configuration, having it
invoke a Perl script that removes the component cache.  But this is
unsatisfactory for two reasons.  First, at the point in the Apache2
lifecycle where this is invoked, there is (as far as I can see) no way
to get at the Mason data-directory setting, so I have to duplicate
that setting in my Apache2 configuration's PerlSetVar MasonDataDir
directive and the script.  And second, I have many different virtual
hosts running from the same set of Mason components, each with their
own Apache2 configuration component and each potentially having a
different MasonDataDir, and I would prefer not to have to duplicate
this script and associated settings for each virtual host.

One neat way to solve this problem would be if I could set up a
"magic" HTML::Mason component -- as dhandler, for example, is magic --
that is automatically run when the web-server starts up.  Is there
such a component?

Or is there a better approach?

Many thanks in advance!

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to