How does thinkphp automatically delete cache files at 00:00 every day?

WBOY
Release: 2016-08-18 09:15:47
Original
1349 people have browsed it

As the title states, the data is updated every day. In order to reduce the access to the database, the data queried on that day is stored in the cache file, and the data will be updated the next day. How to delete the cache file at 00:00?

Reply content:

As the title states, the data is updated every day. In order to reduce access to the database, the data queried on that day is stored in the cache file, and the data will be updated the next day. How to delete the cache file at 00:00?

Timed taskscrontab

<code>#每天凌晨0点执行
00 00 * * * /server/php7.02/php /htdocs/example.web.com/action/post/push.php</code>
Copy after login

Should this be left to the system's crontab and php scripts, or thinkphp's cli mode?

If it is Linux, use crontab
If not, just write while. .

Recommend crontab

It is recommended to use scheduled task crontab+php script which is more suitable

crontab scheduled tasks, it is more reasonable to call the mession.php script

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!