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

save cache page in html and display it directly

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
smartymoon
Smarty Rookie


Joined: 29 Apr 2003
Posts: 15

PostPosted: Tue Jun 14, 2005 3:53 pm    Post subject: save cache page in html and display it directly Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Jun 14, 2005 5:01 pm    Post subject: Reply with quote

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
View user's profile Send private message 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 -> Feature Requests 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