An example of PHP file cache content saving format
This article mainly explains the "PHP file cache content saving format example explanation", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "PHP file cache content saving format example explanation" bar!
1. PHP file cache content saving format
There are three main storage formats for PHP file cache content:
(1) variable var_export is formatted into PHP normal assignment format
(2) variables are saved after serialize serialization and deserialized when used
(3) after the variable is formatted by json_encode, it is saved and used by json_decode.
The test results on the Internet show that the file parsing efficiency of serialize format is higher than that of Json,Json and higher than that of PHP normal assignment.
So if we cache the data, it is recommended that we parse the data in the form of serialization.
2. A simple case of PHP file caching