|
|
@@ -547,10 +547,12 @@ class View extends Object {
|
|
|
* @return boolean Success of rendering the cached file.
|
|
|
*/
|
|
|
public function renderCache($filename, $timeStart) {
|
|
|
+ $response = $this->response;
|
|
|
ob_start();
|
|
|
include ($filename);
|
|
|
|
|
|
- if (Configure::read('debug') > 0 && $this->layout !== 'xml') {
|
|
|
+ $type = $response->mapType($response->type());
|
|
|
+ if (Configure::read('debug') > 0 && $type === 'html') {
|
|
|
echo "<!-- Cached Render Time: " . round(microtime(true) - $timeStart, 4) . "s -->";
|
|
|
}
|
|
|
$out = ob_get_clean();
|
|
|
@@ -564,7 +566,7 @@ class View extends Object {
|
|
|
return false;
|
|
|
} else {
|
|
|
if ($this->layout === 'xml') {
|
|
|
- header('Content-type: text/xml');
|
|
|
+ $response->type('xml');
|
|
|
}
|
|
|
return substr($out, strlen($match[0]));
|
|
|
}
|