Hi,
I have noticed that {elapsed_time} & {memory_usage} are not replaced when a page cache is displayed that has been compressed.
In the Output Class the order of processing is:
First write cache
Then replace the pseudo-variables with the data
Should that not be swapped?
First replace the pseudo-variables with the data
Then write the cache?
Regards,
Martin
I have noticed that {elapsed_time} & {memory_usage} are not replaced when a page cache is displayed that has been compressed.
In the Output Class the order of processing is:
First write cache
Then replace the pseudo-variables with the data
PHP Code:
// Do we need to write a cache file? Only if the controller does not have its
// own _output() method and we are not dealing with a cache file, which we
// can determine by the existence of the $CI object above
if ($this->cache_expiration > 0 && isset($CI) && ! method_exists($CI, '_output'))
{
$this->_write_cache($output);
}
// --------------------------------------------------------------------
// Parse out the elapsed time and memory usage,
// then swap the pseudo-variables with the data
$elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
if ($this->parse_exec_vars === TRUE)
{
$memory = round(memory_get_usage() / 1024 / 1024, 2).'MB';
$output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output);
}
Should that not be swapped?
First replace the pseudo-variables with the data
Then write the cache?
Regards,
Martin