Yes, you can cache your entire HTML file in cache with the APC caching mechanism in CakePHP. Cake CacheHelper will do the job for you. Suppose you have a PostsController , and you want to cache all the files of your kind associated with this controller. In this case, first of all, you must define the following code in your controller.
class PostsController extends AppController { public $helpers = array('Cache'); }
And in your bootstrap.php file you need to add CacheDispatcher .
Configure::write('Dispatcher.filters', array( 'CacheDispatcher' ) );
And now, again in your PostsController , you should talk about cache files.
public $cacheAction = array( 'view' => 36000, 'index' => 48000 );
This will close the action for 10 hours, and the index for 13 hours.
I think that from now on you can serve your entire HTML caching file for your visitors without clicking on PHP or Cake on your server. Thanks.
source share