Generally, caching in file mode can meet the requirements, and thinkPHP also provides a fast caching method F method specifically for file mode.
Since uses the PHP return method, its efficiency is higher than the S method .
The F method has the following characteristics:
1. Simple data caching;
2. Save in file form;
3. Use PHP to return data to load the cache;
4. Support subdirectory caching and automatic creation;
5. Support Delete cache and batch delete;
In this way, the content of the $str string is placed in the file ../Public/Runtime/str/ffun.php
The file content offfun.php is as follows:
Deleting cache is also easy: