June 5, 2007

random facts III

Filed under: ZenMagick — DerManoMann @ 10:23 pm

custom cache settings via local.php

ZenMagick supports individual configuration settings per theme as well as global settings. The code is expected in a file named local.php. The sample file is full of examples to configure ZenMagick one way or the other. A fact that gets ignored here is, that local.php can contain any PHP code.

Sometimes it is desireable to have different page cache settings for different pages. A simple way of implementing this is to have some conditional code in local.php. For example, to increase the page cache time-to-live for static and ezpages, the following code could be used:


if (zm_is_in_array($zm_request->getPageName(), "static,page")) {
zm_set_setting("pageCacheTTL", 600000);
}

Quick upgrade with core.php

It occured to me that one way of quickly upgrading without any outage due to updating the core directory tree is to just replace core.php with a newer version. This will effectively make the storefront use the new version while the admin pages would still use the old code (admin never uses core.php). After that, the core folder can be modified without affecting the store at all….

It’s just important to check that there are no theme changes required that correspond with the update of core. Still, those usually affect only a couple file at most, so not much harm doing them.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.