Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望增加一个缓存自动清理功能或机制。 #2843

Open
augushong opened this issue Feb 20, 2023 · 8 comments
Open

希望增加一个缓存自动清理功能或机制。 #2843

augushong opened this issue Feb 20, 2023 · 8 comments

Comments

@augushong
Copy link

比如文件驱动,设置缓存空间大小,满了就清理最旧的部分。

@yuanzhihai
Copy link
Contributor

php think clear --cache

@augushong
Copy link
Author

主要是自动判断的机制。

@liu21st
Copy link
Member

liu21st commented Feb 20, 2023

定时清理就行了吧 文件缓存之外的也没这个需求

@augushong
Copy link
Author

就跟redis的内存不足的清理机制差不多,看看别人有没有需求吧

@augushong
Copy link
Author

清理缓存时,如果有正在读取的缓存key或正在写入的缓存key。会跳过吗,还是会清理出错。

@hongfs
Copy link
Contributor

hongfs commented Feb 20, 2023

清理两天前的日志

$ find /home/wwwlogs/web/ -name "*.log" -mtime +2 -exec rm -f {} \;

@liu21st
Copy link
Member

liu21st commented Feb 23, 2023

就跟redis的内存不足的清理机制差不多,看看别人有没有需求吧

感觉这个只能增加缓存读写的性能开销 吃力不讨好 命令行单独执行则不影响

@hongweipeng
Copy link
Member

使用 php think clear --cache --expire,虽然有 php think clear --cache 但它是所有缓存文件都删掉,会影响线上使用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants