Re: [SMARTY] RE: Deleting a specific cache id from a different smarty instance

From: Date: Sat, 25 Jan 2003 22:12:28 +0000
Subject: Re: [SMARTY] RE: Deleting a specific cache id from a different smarty instance
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7339@lists.php.net to get a copy of this message
On Sat, Jan 25, 2003 at 03:47:40PM -0600, Monte Ohrt wrote: > Our cache doesn't expire and we use a cron to rm -rf cache files when > necessary. I've never seen a problem with file locking or millisecond > issues. We also use wget immediately after to refresh the cache for the > front page and links on the front page (most often hit pages.) This way > the next user will most likely get a cached page. yes and sorry. I was a bit fast with my assumptions and my first reply. i think a race condition in smarty like this one in Smarty::_write_file() : if ($create_dirs) $this->_create_dir_structure(dirname($filename)); // the directory could have been removed here! if (!($fd = @fopen($filename, 'w'))) { $this->trigger_error("problem writing '$filename.'"); return false; } is not really a problem. if smarty cannot write the cache-file it simply ignores the problem and writes the cache-file the next time, the page requested. right? regards messju > Monte > > On Sat, 2003-01-25 at 14:53, Hoffman, Geoffrey wrote: > > Are curl and wget Smarty-specific, or straight PHP? > > > > Never heard of those. > > > > You bring up an interesting situation... > > How could you tell if someone was in that millisecond? > > > > MM> definitely :) use a smarty cli- or cgi-binary > > MM> for that or fetch a url of a php script that > > MM> flushes the cache. you can use curl or wget for > > MM> that. > > MM> > > MM> the simplest way would be of course to 'rm -r' > > MM> the cache directory, > > MM> but then no file-locking against other > > MM> php-script using the cache is > > MM> done and you may accidently delete > > MM> a page in the (milli-)second another > > MM> process wants to display it. > > > > GH>> Now I just realized that in my publication > > GH>> system, I'm going to need to trash > > GH>> all the summary-display section > > GH>> cache at 12:01 am on each day. > > GH>> Should I use CRON for that? > -- > Monte Ohrt <monte@ispi.net> > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

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