Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

individual template caching

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
bsmith
Smarty Rookie


Joined: 29 May 2003
Posts: 11

PostPosted: Thu Jun 19, 2003 7:43 pm    Post subject: individual template caching Reply with quote

Hello, I am generating a top 5000 listing of records from MySQL, 500 per page, and I want to cache these pages.

Can I have one script to generate the list, using an offset parameter to tell me what page I'm on, and cache the results for say, one day, and the list automatically get updated each day?

I just want this one tempate cached, not the others.

Thanks,
Brian
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Jun 19, 2003 8:02 pm    Post subject: Reply with quote

turn $smarty->caching=true only when you display the list
use your pagenumber as cache_id
use a $cache_lifetime of 86400
use $smarty->is_cached() to check wether you have to rebuild the pages
if so use a for-loop and $smarty->fetch() to generate the cached pages.

this should get you going

greetings
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP