|
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 |
Hichhiker Smarty n00b
Joined: 12 Dec 2008 Posts: 1
|
Posted: Fri Dec 12, 2008 2:16 am Post subject: Compile vs Cache |
|
|
Just for my own education, what is a difference between Compile and Cache in Smarty?
I just wrote an app that uses smarty as frontend and when I went to put it on production box, I turned on caching - thinking it needs to be on .... Nothing happened. Well, I noticed that for dev purposes I turned on "force recompile" - turned that off and voila - all sorts of things start to act strange - I am seeing other users pages as if the app is jumping sessions and other fun stuff.
After some playing with it, I left the force_compile on and turned off caching and things more or less fixed themselves.
So from this I am making following assumptions:
Compile process converts TPL to PHP
Cache process caches the OUTPUT of the PHP (i.e. final generated page) and stores that
Am I right on this? And if so, is there a real world case where caching for a db backed app is useful?
Thanks
-HH |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Dec 12, 2008 8:29 am Post subject: Re: Compile vs Cache |
|
|
Hichhiker wrote: | [...]
Compile process converts TPL to PHP
Cache process caches the OUTPUT of the PHP (i.e. final generated page) and stores that
Am I right on this? |
yes.
Quote: | And if so, is there a real world case where caching for a db backed app is useful? |
you have to use different cache_ids (2nd parameter to display/fetch) to cache different output. |
|
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
|