Filippo oretti
Filippo oretti

Reputation: 49843

Codeigniter enabling profiler with output cache on

i have problem with output benchmark profiler when also output cache is enabled,the benchmark does is not visualized in views.

I'm doing.

class  Home extends MX_Controller {


    function Home()
    {
           parent::__construct();

           $this->output->cache(20000);
           $this->output->enable_profiler(TRUE);
   }

how can i visualize the benchmark to see how faster is the page with cache on?

Upvotes: 0

Views: 9275

Answers (1)

Damien Pirsy
Damien Pirsy

Reputation: 25445

In order for the profiler to work you need to set markers, used as a start and end point to benchmark your application. Because, quoting from the manual:

Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

Wherever you want to start use (you don't need to initialize this class):

$this->benchmark->mark('starting_point');

And, when you want to end it:

$this->benchmark->mark('ending_point');

Then the result:

echo $this->benchmark->elapsed_time('starting_point', 'ending_point');

You can use as many as you want, just give them a different name of course.

Upvotes: 4

Related Questions