RE: [SMARTY] Clear cache for entire site

From: Date: Fri, 09 Apr 2004 21:42:53 +0000
Subject: RE: [SMARTY] Clear cache for entire site
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11263@lists.php.net to get a copy of this message
THANKS! -----Original Message----- From: DC [mailto:dan@dbmscan.com] Sent: Friday, April 09, 2004 1:20 PM To: Smarty Post Subject: RE: [SMARTY] Clear cache for entire site have a look at: http://smarty.incutio.com/?page=CacheAndCompile there are links there to several forum threads and old email discussions on caching. it also lists all of the functions and variables that deal with caching and compiling. It is not done by any means since there is a lot to learn about caching in Smarty. But, feel free to add what you learn and add examples. To do url query driven cache groups just put the get query vars like so $cache_id=$_GET['urlattribute1'] .'|'. $_GET['urlattribute2']; $smarty->clear_cache("index.tpl",$cache_id); the md5 technique is handy but it has exactly the limitation you described in that it doesn't let you do true cache groups. also, don't forget to set your cache timeout. it took me a while to realize that the pages i thought were cached were actually expiring underfoot. the other thing to be aware of when passing something like cache=off in the url is that if you use something like $_SERVER['REQUEST_URI'] to create dynamic links, each one of those links will have cache=off embedded in it. i got around this by creating a variable called $server_query_clean and use string replacement to hack off the cache=off. when i want to make sure i am avoiding the cache clearing when building links (which is almost always), i use that variable. HTH, dan -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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