Multidimensional cache ID, wildcards
| From: | Anders Janson | Date: | Wed, 28 Nov 2001 15:46:26 +0000 |
| Subject: | Multidimensional cache ID, wildcards | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2074@lists.php.net to get a copy of this message | ||
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