CI provides database cache and page cache. If a page is purely static, use the page cache directly. If a page contains a database query, do you want to cache the database or directly use the page cache? If it seems that the page cache is used, can the database query cache be used? CI provides database cache and page cache. If a page is purely static, use the page cache directly. If a page contains a database query, do you want to cache the database or directly use the page cache? If it seems that the page cache is used, can the database query cache be used?
Reply content:
CI provides database cache and page cache. If a page is purely static, use the page cache directly. If a page contains a database query, do you want to cache the database or directly use the page cache? If it seems that the page cache is used, can the database query cache be used?
We recommend that you use page caching for content stations, portal homepage, and article pages.
If a page is purely static, use the page cache directly.
The cache is not needed if it is purely static.
If a page contains a database query, do you want to cache the database or directly use the page cache? If it seems that the page cache is used, can the database query cache be used?
If there is a database, you can check the page usage scenario to determine which cache to use. If it is an article, the page is cached. If it is a system that contains a lot of program logic, it will cache the database. It is generally used in combination.
Yes, this is what the page cache is.
However, some problems may occur in actual use. For example, for a large page, most of the data is static, and a bean curd block is real-time. This is embarrassing.
Therefore, the cache template + data cache method is generally used. That is, cache the template of the entire page, and then fill the template with the data cache, a real-time bean curd block to be filled in real time.
Another method is that, even if real-time data is processed using ajax and other caches, this method is not recommended because blocks are blank and ugly before being loaded.
You can take a look at the smarty information. This is basically the idea. Sometimes there is a trade-off between performance and maintainability. If the changes are small, they are purely static. If the changes are large, templates are used.