我一直幸福地CakeResponse::disableCache();
从beforeFilter()
of调用AppController.php
禁用浏览器缓存,据我所知,它运行良好。
但是,自从升级到 PHP5.4 后,我收到了以下严格警告:
Strict (2048): Non-static method CakeResponse::disableCache()
should not be called statically, assuming $this from incompatible
context [APP/Controller/AppController.php, line 53]
该功能似乎仍然有效,但错误告诉我我误解了一些非常基本的东西,并且可能有一种不同的(和更好的)方法来做到这一点。
所以,如果我需要在应用程序范围内禁用浏览器缓存(即:no-store, no-cache, must-revalidate
等),那么在 Cake 2.3 中执行此操作的最佳方法是什么?