-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Yii2 Application Development Cookbook
By :

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.
Activate the caching component in config/web.php
as follows:
return [ // ... 'components' => [ cache => ['class' => 'yii\caching\FileCache, ], ], ];
Set up a fresh database...
Change the font size
Change margin width
Change background colour