Is full page caching possible with APC? (CakePHP)

I have my cache site using full page caching. Therefore, an html file is created for each page.

Since I use CakePHP, I can determine that APC caching will be used instead of file caching. However, if this is done, html files are still created (APC is installed correctly).

So the question is: is there any logic in using APC with full page caching? Does it provide any benefits? Is it possible to somehow put the cached html file in RAM and read it where necessary?

PS I'm not talking about caching functionality for APC code. Just data caching.

+1
source share
1 answer

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.

+1
source

All Articles