Cache And Execution Time

I’m using the Yii Cache functions. The implementation is so easy, I like it.

I’m caching a whole page with the filter method in the controller:


public function filters()

{

    return array(

        array(

            'COutputCache',

            'duration'=>100,

            'varyByParam'=>array('id'),

        ),

    );

}	

But although it seems to be faster, how can i measure it? I’ve got this in the footer:


<?php echo round(Yii::getLogger()->getExecutionTime(),3); ?>

But this is ofcourse also cached, so it won’t change :).

How can I exclude this part from caching?

I think it’s not possible after more searching.

So instead I used CWebLogRoute for profiling and although it has no total execution time value, I can calculate it by the Timestamp for each trace.

Without caching a average page took about 0.06 seconds to load. With cache it’s now 0.01 seconds or less! :lol:

Super fast, I like it.