|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bsmith Smarty Rookie
Joined: 29 May 2003 Posts: 11
|
Posted: Thu Jun 19, 2003 7:43 pm Post subject: individual template caching |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jun 19, 2003 8:02 pm Post subject: |
|
|
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 |
|
|
|
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
|