Re: Multidimensional cache ID, wildcards

From: Date: Wed, 28 Nov 2001 16:19:10 +0000
Subject: Re: Multidimensional cache ID, wildcards
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2075@lists.php.net to get a copy of this message
The next release of Smarty (1.5.0) will support custom functions for cache handling. Therefore, you can design the cache to work however you wish. Some ideas are wildcard searches on filenames, save/store cache data in a db, msession (http://www.mohawksoft.com/phoenix.html), etc. Smarty will call custom functions to get/save cached data, how that actually happens is up to your functions. I have the code in place, now it is a matter of testing. We're finishing up a few things first (like {foreach}) before releasing a snapshot. Anders Janson wrote: > > Help! Ideas, please!! > So far, I have avoided cached pages completely, because I don't know how > I will approach this problem: > > - The site will have several skins/themes, and visitors may choose any > theme they want. > - They may also specify the language the site shall use. > - There are pages with unique page IDs. A page is anything from a static > text to a high traffic forum page. > > I would like to use the page ID, language and the theme as cache IDs. > Sort of "is_cached ('GREEN', 'swedish',1234)". > And then do things like "flush('*','*',1234)" when I change page > 1234, > or "flush('GREEN','*','*')" if I should redesign the > theme. > My first idea was to concatenate language, theme and page ID to make a > cache ID, and flush everything when ANYTHING changes. Blah! > Second idea: Have three separate index arrays ( $theme['GREEN'][] = > $newConcatenatedID; and so on...). But these arrays must be stored in > the DB or a file.... Blah again, I think. > > Has anybody else faced this multidimensional problem? What would you do? > > /Anders > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.smarty.general (#2075) next »