Using cache dependencies and chains
Yii supports many cache backends, but what really makes the Yii cache flexible is the dependency and dependency chaining support. There are situations when you cannot simply cache data for an hour because the information cached can be changed at any time.
In this recipe, we will see how to cache a whole page and still always get fresh data when it is updated. The page will be of the dashboard-type and will show the five latest articles added and a total calculated for an account.
Note that an operation cannot be edited as it is added, but an article can be.
Create a new
yii2-app-basic application using the Composer package manager, as described in the official guide at http://www.yiiframework.com/doc-2.0/guide-start-installation.html ...