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

How to cache the include file

 
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
ShenKong
Smarty Rookie


Joined: 20 Jan 2004
Posts: 27

PostPosted: Sun Mar 28, 2004 12:45 pm    Post subject: How to cache the include file Reply with quote

First of all , thanks boots .

Now I am working on a PHP web site . called openphp.cn , the web team now has only one person -- me . Sad

But I am very glad there are many ebullient people here , help me . Thanks ..

Now the question :

In main.tpl .....
Code:
<table>
    <tr>
        <td>{include file="menu.tpl"}</td>
        <td>{include file="body.tpl"}</td>
    </tr>
</table>

How to set the cache_lifetime for menu.tpl ? or any other way to set the lifetime of menu.tpl .
_________________
Something comes soon ...
http://www.showtop.net
http://www.openphp.cn
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Mar 29, 2004 6:58 am    Post subject: Reply with quote

Hi again ShenKong! Thanks for the nice words Smile

As for your problem, as far as I know, Smarty does not allow for multiple cache-lifetimes to be specified. You can pre-compile your indluded scripts using a different cache-lifetime, but that won't help much in general as the next time they are invalidated, they will be recreated with the current ttl settitngs.

Never-the-less, this topic has been discussed and a start of a solution (called clipcache) can be seen in this thread. It has been used with this custom cache-handler which you may also find interesting.

HTH
Back to top
View user's profile Send private message
ShenKong
Smarty Rookie


Joined: 20 Jan 2004
Posts: 27

PostPosted: Tue Mar 30, 2004 1:20 pm    Post subject: Reply with quote

It is hard to understand these two topocs ... thanks boots . I think I needn't to include it. but instead to cut the tpl file to some pieces , and display them .

and , smarty has a notice :

line 1185 :
Smarty.class.php
Undefined index: insert_tags
_________________
Something comes soon ...
http://www.showtop.net
http://www.openphp.cn
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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