Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Compile vs Cache

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Hichhiker
Smarty n00b


Joined: 12 Dec 2008
Posts: 1

PostPosted: Fri Dec 12, 2008 2:16 am    Post subject: Compile vs Cache Reply with quote

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


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Dec 12, 2008 8:29 am    Post subject: Re: Compile vs Cache Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    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