In every documentation of CakePHP it is written that requestAction decreases performance of the CakePHP. It is always reccomended to use controller action and get results with the view file. But sometimes I really need requestAction.
If used without caching requestAction can lead to poor performance. It
is rarely appropriate to use in a controller or model.
What processes make reuqestAction to decrease performance.
What should one do, to prevent performance loss of requestAction ?
Adding thing like that ?
$this->autoRender = false
to controller action,
function beforeFilter() {
if ( $this->params['action'] == "myaction" ) { return; }
}
to controller class
You could start by looking at how it is written.
As I read it, it would each time it would re-parse the URL (in
Router::normalize()), creates newCakeRequestinstance (which always loads configuration) and then try toDispatcher::dispatch().P.S. .. it’s a giant mess, i don’t even see at which point cache there is used .. if ever.