TiuTalk/HtmlTidyComponent — Issue #3: LazyLoad
Author: TiuTalk
Created: 2011-12-02 10:15:10+00:00
State: open

https://groups.google.com/forum/?hl=pt#!topic/cake-php/NKbm1GgG8OA

Instanciating Tidy in the constructor means you're loading a class on all requests which potentially you're not going to use just by including the component. However implemented it should lazy-load wherever possible (that means new Tidy() is called the first time you actually try to use the class - not optimistically loading it early). In practical terms that means only check settings in constructor/setup functions - do as little as possible.