Re: re: TreeMenu and Recursive algorithms

From: Date: Thu, 10 Apr 2003 12:38:58 +0000
Subject: Re: re: TreeMenu and Recursive algorithms
References: 1 2 3 4 5 6 7  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4779@lists.php.net to get a copy of this message
Demian Turner wrote:
Hi Wolfram, that's done the trick, thanks! I was debugging with a print_r(), the $tree->varDump() output is much better :-) I was curious to compare the tree loading speed with Richard's Tree class, I have a client insisting I use 350 nodes about 5 deep and it's pushing the limits, at least from the browsers point of view.
in this case i would suggest that you cache the tree. What i am doing in a project is: I have an external JS file, where the TreeMenu stuff is genereated in and the file is included by the HTML page via <script src="...">, i guess you know what i mean. and then I use HTTP_Header_Cache to cache the page and only send a 304 (Not Modified) header so the browser doesnt reload the JS-file again, but uses the one it has in the cache. Now you only have to handle the caching behaviour yourself, since you dont want to send a 304 when the tree needs to be updated at the user agent. this way i am saving a lot of traffic and the tree only gets regerenated when it was updated. and of course i also cache the resulting js-file in the application, so the Tree-class doesnt have to do a lot of work. (Xipe does that) You can see that's quite a mix of caching, and i definitely needed more time to get it all runnning properly than to write this mail :-) but its worth it i guess (btw i did that for the www.timetool.biz) hth -- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/auth

« previous php.pear.general (#4779) next »