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

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


Joined: 30 Jul 2003
Posts: 9
Location: New Zealand

PostPosted: Wed Jul 30, 2003 8:05 am    Post subject: caching... Reply with quote

Hi, I have been using Smarty for 1 week, adn I don't think I quite "get it" yet.

I would like to know why my smarty built pages don't refresh until I have resaved the template file. What happens if I am working in a databse, adding new content, or working on the logic of a php file, and I upload changes? Nothing! Sad I don't see any changes until I resave the template file. Is this silly, or am I missing the point?

Thanks.

GG
_________________
I suck at web development.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
boots
Administrator


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

PostPosted: Wed Jul 30, 2003 4:11 pm    Post subject: Reply with quote

Smarty is not misnamed Smile It tries to be clever (ie. least work or fastest) about fulfilling template requests. This behaviour is also controllable.

It appears that you have Smarty set to cache templates but also to check to see if template recompilations are required. That means:

1) Smarty checks to see if the template SOURCE CODE has been altered since it last compiled the template. If so, it RECOMPILES (and thus reruns) the template.

2) IF the template is NOT being recompiled then Smarty checks to see if a cached version of the template already exists. If so, then instead of re-running the template, it simply serves up the previously cached version.

This explains the behaviour you are seeing. As I mentioned, you have control over this. For one thing, you can associate multiple, unique cache_id's with a given template. Each cache_id results in a seperate cache file for that template. In your case, you would likely gather the request vars and then generate an appropriate cache_id for that request. There is more detail on this in the manual.

HTH
Back to top
View user's profile Send private message
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