比尔盖子 博客

AutoOptimize——比尔盖子磁盘空间耗尽的元凶

总是感觉自己VPS上的CentOS无缘无故填完整个硬盘,一直以为是日志文件弄得。正如df -h告诉我的:

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde              15G   11G  3.3G  77% /mnt/centos

但是刚才使用du统计我自己的网站大小,居然发现/wp-content/cache/autoptimize/文件夹中有N个文件,比尔盖子觉得缓存这么多很不爽,于是想使用

rm ./html/blog/wp-content/cache/autoptimize/autoptimize*

把这些文件干掉。结果得到错误提示:

-bash: /bin/rm: Argument list too long

啊哈?!里面的文件多到已经超过rm的处理能力了!?换用命令:

rm -r  ./html/blog/wp-content/cache/autoptimize/
#为了防止WP报错,因此还需建一个目录
mkdir  ./html/blog/wp-content/cache/autoptimize/

等待了1分钟,终于结束删除了,这时候df -h一下,居然发现

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde              15G  4.1G   10G  29% /mnt/centos

比尔盖子都不知道怎么形容了……这些缓………缓存居然用了7GB的硬盘空间!
经过搜索,终于在网络上找到了此问题的正解:

“这里需要注意的是:Autoptimize插件会自动在它插件目录下的Cache文件夹中储存经过优化的缓存数据,如果你页面使用的是不同的样式表,就可能会导致文件夹变大,那么,你就需要启用只在<head>中寻找样式表了。”

原来如此!

Categories: 未分类

比尔盖子虚拟主机1.0(代号Mango) 开发的那些事 » « 说说明文密码那些事

发表评论

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Copyright © 2023 比尔盖子 博客

Theme by Anders NorenUp ↑