Forums / Developer / Template cache

Template cache

Author Message

Mazen Alsibai

Thursday 13 October 2005 3:18:27 am

Hi:
what is the advantage and the disadvantage of setting TemplateCache=enabled ?
thanks

Nathan Kelly

Friday 14 October 2005 6:16:40 am

Hi, as far as I know setting template cache to "disabled" is good when developing your site. This means your template code is not cached thus each change you make to your templates during development will not require you to clear cache and the changes will be immediately obvious.

If template cache is "enabled" your template code is cached and compiled to reduce loading time from the server to the user. However if you make changes to your templates you won't see those changes until after you have cleared the cache.

Basically template caching reduces the processing time when a page loads, because templates don't change "dynamically" they can be compiled into a format that allows them to be loaded quickly.

If they weren't cached, each time a user accesses a page each template used would need to be processed and compiled on the fly, this would result in reduced server performance. You would notice this performance drop significantly on high traffic sites because each user that accesses the site would need the templates processed.

I hope this answers your question?

Cheers!

Pardon me while I burst into flames...

Mazen Alsibai

Saturday 15 October 2005 12:37:46 am

Hi:
that is exactly what i want to know
thanks