Manipulating the HTTP cache is a great way to control the impact of visitors and users on your application's resources. CakePHP provides a range of options to control both expiration and validation, and manage how clients and proxies engage with your content.
In this recipe, we'll look at the various ways you can handle the HTTP cache to your advantage.
In this recipe, we'll use a simple controller to show each of the caching options available. So, create a file named CacheController.php
in app/Controller/
, with the following content:
<?php App::uses('AppController', 'Controller'); class CacheController extends AppController { public $autoRender = false; }