|
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 |
smartymoon Smarty Rookie
Joined: 29 Apr 2003 Posts: 15
|
Posted: Tue Jun 14, 2005 3:53 pm Post subject: save cache page in html and display it directly |
|
|
what i want?
I would like to save cached page into static page
so that, next time, i will display this saved static page
without going thru sql, smarty,
until i need to update the page and save it again.
i.e. i would create any page thru smarty with template
but if it's static enough for long time,
i would like to create genuine html page and use it again and again.
the reason is that loading smarty takes time and memory,
so it's good to avoid using smarty as many as possible.
so i need this kind of method in smarty
fetch_and_save
this fetches cached or compiled page and save it somewhere
in html format without any smarty specific commands
then we can do the following in php
Code: | if page is static and exists {
include "/smarty/html/saved_page.html" ;
}
else {
do_smarty_job();
$smarty->fect_and_save();
include "/smarty/html/saved_page.html";
}
|
thanks
s. moon |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jun 14, 2005 5:01 pm Post subject: |
|
|
If you want to avoid loading the Smarty library with a static page cache, then use any third party caching solution such as PEAR Cache, or roll your own. |
|
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
|