Page 1 of 1
Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 9:19 am
by NickR
Hi,
At what level(s) does the cache work, is it query caching, page or output caching ?
If it uses query caching can I disable it ?
Thanks, Nick
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 9:56 am
by Ted
It's using smarty for caching. Basically, it keeps a cached version of the compiled smarty template in tmp/templates_c and only goes out to the database to get another version of the template(s) if they're timestamps are older than the ones in the database.
(The word template in smarty is different from CMSMS's usage. It's meaning any chunk of text that smarty needs to process. A content block, global content block, template or any templates used by a module fall into this category.)
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 10:02 am
by NickR
Ted wrote:
It's using smarty for caching. Basically, it keeps a cached version of the compiled smarty template in tmp/templates_c and only goes out to the database to get another version of the template(s) if they're timestamps are older than the ones in the database.
(The word template in smarty is different from CMSMS's usage. It's meaning any chunk of text that smarty needs to process. A content block, global content block, template or any templates used by a module fall into this category.)
So that means any content output from any module can be cached by smarty as well ?
Nick.
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 10:44 am
by Ted
Templates cache, but the actual content shouldn't. In the case of modules, that would mean that anything like {$title} should be created everytime. It's just that the compiled template would have an echo $title; instead of {$ititle} in it.
Does that make any sense? (it's still early here.

)
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 11:03 am
by NickR
Ted wrote:
Templates cache, but the actual content shouldn't. In the case of modules, that would mean that anything like {$title} should be created everytime. It's just that the compiled template would have an echo $title; instead of {$ititle} in it.
Does that make any sense? (it's still early here.

)
Why do you say content shouldn't (cache)?
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 12:13 pm
by Ted
If module output cached, there would be no way for the smarty to know the content updated just by looking at templates. You could then have it cache the output based on rules from the module knowing when content has changed or whatever, but it just makes it too difficult to code a simple module.
We do our best job to mix caching, dynamicism (probably not a real word) and ease of development.
And to be honest, real caching of the output doesn't speed it up that much (we've tried it). Including files is slower than easy sql queries... at least in php.
The only way to get it REALLY fast is to output static html and skip the php stuff all together. But then you really lose your dynamic abilities.
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 12:32 pm
by NickR
Ted wrote:
If module output cached, there would be no way for the smarty to know the content updated just by looking at templates. You could then have it cache the output based on rules from the module knowing when content has changed or whatever, but it just makes it too difficult to code a simple module.
We do our best job to mix caching, dynamicism (probably not a real word) and ease of development.
And to be honest, real caching of the output doesn't speed it up that much (we've tried it). Including files is slower than easy sql queries... at least in php.
The only way to get it REALLY fast is to output static html and skip the php stuff all together. But then you really lose your dynamic abilities.
Cheers, makes sense.
Could be possible to write a helper function that can take the querystrings from a module and write them as properties/params into the templates tags - this helper function could be called as part of the functionality that loads a module... but I dont even know if smarty has the ability to differentiate in this way - ideally we would want it to only store the blocks of output that vary, not the whole pages !
I think the best approach for general performance is good php and good queries - output caching should only be used to survive a slashdot.
Cheers Nick
Re: Question about CMS made simple's cache
Posted: Tue Jun 20, 2006 9:05 pm
by Maarten
Ted wrote:
If module output cached, there would be no way for the smarty to know the content updated just by looking at templates. You could then have it cache the output based on rules from the module knowing when content has changed or whatever, but it just makes it too difficult to code a simple module.
We do our best job to mix caching, dynamicism (probably not a real word) and ease of development.
And to be honest, real caching of the output doesn't speed it up that much (we've tried it). Including files is slower than easy sql queries... at least in php.
The only way to get it REALLY fast is to output static html and skip the php stuff all together. But then you really lose your dynamic abilities.
But just thinking out loud. Isn't it an idea to render a HTML page after each safe. For example you edit some content and when the user press save the system creates a static page which can be loaded until a new edit has been made. offcourse some element like time can be a problem.
Re: Question about CMS made simple's cache
Posted: Thu Jun 22, 2006 12:04 pm
by NickR
Ted,
Just one more thing, release 0.13 has smarty caching turned off, is this the same caching as mentioned above or something different ?
Cheers Nick
Re: Question about CMS made simple's cache
Posted: Thu Jun 22, 2006 12:07 pm
by Ted
It's actually something different. Smarty then has this extra ability to cache the actual html ouput of the templates. However, it's just an extra step that really doesn't gain us much, given the nature of the system. Because everything that's inside a {} doesn't technically cache (at least in smarty's way to seeing it), the tempaltes and the cached output would basically be exactly the same....just with more disk I/O time.
Re: Question about CMS made simple's cache
Posted: Thu Jun 22, 2006 1:50 pm
by NickR
Ted wrote:
It's actually something different. Smarty then has this extra ability to cache the actual html ouput of the templates. However, it's just an extra step that really doesn't gain us much, given the nature of the system. Because everything that's inside a {} doesn't technically cache (at least in smarty's way to seeing it), the tempaltes and the cached output would basically be exactly the same....just with more disk I/O time.
Cheers, if the code is well written output caching will only gain you a little page load time - very little if you use eaccelerator as well.
Re: Question about CMS made simple's cache
Posted: Mon Dec 11, 2006 11:47 pm
by philight
Maarten wrote:
Isn't it an idea to render a HTML page after each safe. For example you edit some content and when the user press save the system creates a static page which can be loaded until a new edit has been made. offcourse some element like time can be a problem.
That's exactly the function i'am looking for because of a poor hosting and i'm close to have a nervous breakdown... online.net a french service very bad with CMSMS and very bad by the way!!
Did someone experience a solution to output static html and make update each time pages are edited?
Philight