Fast Velocity Minify WordPress 插件
描述
HTML, CSS & JS optimization plugin for developers and advanced users. Note you need to look into the HELP tab after installing the plugin and manually configure it for your site. Each site is different, so the default recommendations may or may not work for you and you will need to test and find out how to adjust your settings.
Minification is done on the frontend during the first uncached request. Once the first request is processed, any other pages that require the same set of CSS and JS files will be able to reuse the same generated static CSS or JS file.
If your cache is growing significantly, this could mean one of your CSS or JS files is dynamic and changes on every pageview. In that case, you would need to add the file to the ignore list, else the cache would grow indefinitely (because obviously the original files themselves are dynamic and when you minify, the plugin sees a different file).
Kindly read the HELP section after installing the plugin, about possible issues and how to solve them.
Additional Optimization
I can offer you additional custom made
optimization on top of this plugin. If you would like to hire me, please visit my profile links for further information.
WP-CLI Commands
- Purge all caches:
wp fvm purge
- Purge all caches on a network site:
wp --url=blog.example.com fvm purge
- Purge all caches on the entire network (linux):
wp site list --field=url | xargs -n1 -I % wp --url=% fvm purge
How to customize the cache path ?
You need a public directory to store and serve minified cache files. If you need to customize the path and url, you need to edit your wp-config.php
and add both define('FVM_DIR', '/path/to/example.com/your/public/directory');
and define('FVM_URL', 'https://example.com/your/public/directory');
.