cakephp_dev1
cakephp_dev1

Reputation: 159

how to cache view in cakephp 3

I don't seem to be able to find any information on how to cache the whole HTML page in cakephp3, anyone can help on this, I was able to do it in cakephp 1.2, if I need to cache the whole page like url /products/show/1, I just declare below in a ProductsController, and the page will be cached

var $cacheAction = array( 'show' => '72 hour');

another question, is there a similar tag in cakephp3 that works something like cake:nocache in cakephp1.2

thank you

Upvotes: 2

Views: 1383

Answers (1)

ndm
ndm

Reputation: 60503

The cache helper has been removed in CakePHP 3, as it wasn't a proper, generic implementation to begin with. It is recommended that you use a caching server like Varnish or Squid, and use Edge Side Includes (ESI) if you need to account for dynamic content.

CDNs like Akamai, Cloudflare, etc support ESI too, or even custom implementations. For other cases check out plugins like for example cakephp-cache, or learn about the CakePHP request cycle and middleware if you want to roll your own solution.

See also

Upvotes: 2

Related Questions