|
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 |
gtgibson Smarty Rookie
Joined: 30 Jul 2003 Posts: 9 Location: New Zealand
|
Posted: Wed Jul 30, 2003 8:05 am Post subject: caching... |
|
|
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! 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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jul 30, 2003 4:11 pm Post subject: |
|
|
Smarty is not misnamed 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 |
|
|
|
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
|