+1 for this question .
what i can help from the basic code, , the cache system is already enabled by default in blesta Configure::set("Caching.on", true) .
a sample code like this can work , but not tested .
$cache = Cache::fetchcache('your_plugin_controller_pdt_file', $this->company_id . DS . 'plugins' . DS );
// if a copy of cache existe
if ($cache) {
// here you should return the cached file
return unserialize(base64_decode($cache));
}
// no cache existe , return output and create cached file
else {
$pdt_file = $this->view->fetch("your_plugin_controller_pdt_file"); // get the pdt file
// create cached file if cache system enabled
if ( (Configure::get('Caching.on') && is_writable(CACHEDIR)) ) {
Cache::writecache('your_plugin_controller_pdt_file', base64_encode(serialize($pdt_file)), strtotime( Configure::get('Blesta.cache_length') ) - time( ), $this->company_id . DS . 'plugins' . DS );
}
}