From: <php...@li...> - 2002-11-18 23:00:18
|
+ 1 Woot, I likes a lot. I think I will implement that in my modules to. Steven > Greetings, > > While working on calendar, I needed to create a year view. This > particular view is extremely process heavy as it has to create each > month using templates. I was hitting one template for each day, week, > and month. 7 * 5 * 12 = 420 average file hits for the year view. > > Phew. > > Well what I decided to do was store this data in a session array keyed > into the year. So whenever that year is hit, it delivers the data > without having to hit all those files again. > > Then I thought of another way to speed up time. The processTemplate > function allows you to send a string instead of a filename. So if I > stored that template file information, I could just send it instead. > > After this, I thought why not combine the two? So I copied the > processTemplate function into layout. > > This processTemplate looks in a session named Template. It is indexed by > the module name and filename. If the session component exists, it used > it INSTEAD of loading the file. If it does not exist, it goes on before > loading the file and processing it. It then copies the template file > into the session. > > My file hits should go from around 420 to 3. > > Now I could have just pulled those files separately but, with the > session, it carries over from function to function. The month creation > script would lose that template file each one of the eleven other times > it was hit for the year view. > > IMHO I think this could be a substantional speed increase were it > implemented in the core. However, there might be issues I am unaware of. > > So I would like discussion on whether this should be implemented into > the processTemplate function. > > Please vote and post! > > Thanks, > Matt > > > Matthew McNaney > Internet Systems Architect > Electronic Student Services > Email: ma...@tu... > URL: http://phpwebsite.appstate.edu > Phone: 828-262-6493 > ICQ: 141057403 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: To learn the basics of securing your > web site with SSL, click here to get a FREE TRIAL of a Thawte Server > Certificate: http://www.gothawte.com/rd524.html > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers -- Steven Levin Electronic Student Services Appalachian State University Phone: 828.262.2431 PhpWebsite Development Team URL: http://phpwebsite.appstate.edu Email: st...@NO... |