Hi Tony, On Wed, 2003-09-24 at 10:23, Tony Lee wrote: > I can't seem to get a grip on the mod-midgard-preparser. So it caches > everything to /var/www/midgardpages?
You'll have to point the MidgardPageCacheDir directive to the directory
where you want the cache files to be stored.
MidgardPageCacheDir /var/www/midgardpages
for your example location.
> Once I've done a make install and included it in my midgard-data
> configuration how do I turn it off if I want to test how things are
> working without it?
Remove/comment out the MidgardPageCacheDir directive in your
midgard-data configuration,
# Commenting out MidgardPageCacheDir automagically disables
# caching behaviour of mod_midgard_preparser
#
# MidgardPageCacheDir /var/www/midgardpages
and point you a different midgard-root.php (the midgard-root.php for
preparsed and non-preparsed differ, you'll need the non-preparsed if you
comment out the MidgardPageCacheDir directive.
HINT: In current cvs there's a function mgd_preparser_active (thx
Emile), that allows you to create a midgard-root.php that works for both
situations:
...
if (mgd_preparser_active === TRUE) {
?>
<[code-compat]>
<[code-global]>
<[code-init]><?php
if ($midgard && $midgard->style == 0) {
$what = "content";
?><[content]><?php
} else {
$what = "ROOT";
?><[ROOT]><?php
}
} else {
mgd_eval("?>".mgd_template("code-compat")."<?","code-compat");
mgd_eval("?>".mgd_template("code-global")."<?","code-global");
mgd_eval("?>".mgd_template("code-init")."<?","code-init");
if ($midgard && $midgard->style == 0) {
mgd_eval("?>".mgd_template("content")."<?","content");
} else {
mgd_eval("?>".mgd_template("ROOT")."<?","ROOT");
}
}
...
This is of course sub optimal for production purposes, but very
convenient when testing and switching a lot.
> I'm also a little confused about how this will work with a staging/live
> setup. What happens when the 2 servers are both looking in the same
> folder for their cached pages? They don't overlap?
There's a good chance they do overlap, and an ever bigger chance that
that will yield very weird results, I would imagine.
> And if they do how
> can I set up the Aegir staging/live server to avoid it?
<VirtualHost 192.168.2.1:80>
# Live Server
MidgardPageCacheDir /var/cache/midgard/pages/live
...
</VirtualHost>
<VirtualHost 192.168.2.1:8001>
# Staging Server
MidgardPageCacheDir /var/cache/midgard/pages/cache
...
</VirtualHost>
There was a bug with the pagecache code in the 1.5 release, so if you
are running this release, you may notice that changes to pages don't
show until you've manually emptied the cache directory when the
MidgardPageCacheDir directive is enabled, and switching styles may not
be picked up until the cache table is emptied by hand, even when the
MidgardPageCacheDir is disabled.
There's a fix for that in CVS, and if you have the possibility to give
current CVS a swing, I would really appreciate that. The non preparsed
mod_midgard will be deprecated in next release, and will go away
completely eventually. So the more daylight the preparser code gets, the
sooner bugs will be found and fixed.
wkr,
--
Envida http://www.envida.net/
Armand A. Verstappen Graadt van Roggenweg 328
[EMAIL PROTECTED] 3531 AH Utrecht
tel: +31 (0)30 298 2255 Postbus 19127
fax: +31 (0)30 298 2111 3501 DC Utrecht
signature.asc
Description: This is a digitally signed message part
