On a CakePHP site (2.3.1) I have noticed the cached view file size is very large (10-60MB) per page.
Typically with sites I would expect the caching to just store pure HTML output but Cake is adding serialised PHP at the top of the files. From a performance perspective this large file size is problematic, using up gigabytes of space (we have 1000s of pages), and is not suited to APC caching (default max file size 1MB).
This is an example block at the top of the cached view file:
<!--cachetime:1363985272--><?php
App::uses('StaticController', 'Controller');
$request = unserialize(base64_decode('<removed>'));
$response = new CakeResponse();
$controller = new StaticController($request, $response);
$controller->plugin = $this->plugin = '';
$controller->helpers = $this->helpers = unserialize(base64_decode('<removed>'));
$controller->layout = $this->layout = 'default';
$controller->theme = $this->theme = '';
$controller->viewVars = unserialize(base64_decode('<removed>'));
Router::setRequestInfo($controller->request);
$this->request = $request;
$this->viewVars = $controller->viewVars;
$this->loadHelpers();
extract($this->viewVars, EXTR_SKIP);
?>
I'd prefer no PHP in there at all, as the HTML below is the static generated output. A massive overhead that accounts for all the file size.
Cache setting in bootstrap.php:
Cache::config('default', array('engine' => 'Apc'));
At present my only option is to improve the file size of the view cache files. Adding something like Varnish is not possible on this server as this point in time.
Any tips to resolve the file size issue would be great.