Most website developers tend to ignore caching without realizing that it can harm their applications. A one-second delay in access time can mean you're losing customers or users to competitors. Yii2 supports caching in a variety of methods. Supports fragment caching, data caching, page caching, and dynamic content. Cache storage components can be exchanged without having to change the code that uses the cache. In this article, we will make a comparison of cache speeds in several methods. Without using cacheFileCacheDbCacheRedis Steps to make a cache speed comparison on yii2 Set up a table by using MySQL CREATE TABLE 'test_cache' ( 'id' INTEGER(11) NOT NULL AUTO_INCREMENT, 'data' VARCHAR(20) COLLATE utf8mb4_general_ci DEFAULT NULL, PRIMARY KEY USING BTREE ('id') ) ENGINE=InnoDB AUTO_INCREMENT=1 ROW_FORMAT=DYNAMIC CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'; Create a simple table with id and data columns. Then create a record for the table. In this trial, we added a data column with random characters with 20 characters. The number of lines we create is 10,000 lines. Create a model of the table, for example with the name "Testcache".Create a Controller to display a response, for example under the name "TestcacheController" "TestcacheController" without cache public function actionIndex() { $data=TestCache::find()->all(); Yii::$app->response->format = yiiwebResponse::FORMAT_JSON; return $data; } "TestcacheController" with cache public function actionIndex(){ $data =...