cakePHP has view caching built in which when used cleverly will really speed up your applications.
However, this doesn't work with requestAction.
Let's consider this example:
1. You store all your categories in a database.
2. While displaying your views, you want to pull these categories from the DB.
3. You don't want that every time you display a page, you should pull the categories from DB. Since they are not going to change (till you change them :) it's an unnecessary hit on the DB.
4. You want to load these categories at startup and then just keep pulling the data from the cache rather than the DB.
There can be many ways of doing this, but one of them could be that whenever the category data is first requested, we hit the DB and get the list of categories, then cache them (in a file) and subsequent requests would be served from reading the file (it could be stored in the session too).
So, I decided to give this a shot. cakePHP already has a cache() function that can be used for achieving something like this.
Here is what I came up with:
getEnumValues is something I got as a snippet from cakeforge.
So, that's it, you can now do the following in your controller: