Here is a video showing the steps to use Better WordPress Minify yes its outdated but still works great for version 4.4+ of WordPress. Really it just minifies so what is there to change?
Make sure to use the Advanced settings to get the most out of it. Add this to you functions.php
add_filter('bwp_minify_get_buster', 'bwp_minify_get_buster'); function bwp_minify_get_buster($buster) { return 'my-custom-buster'; }
Then you will get some code for your.htaccess rules. Add it to get the expired headers for the minified js and css.
# BEGIN BWP Minify Rules # BEGIN BWP Minify Headers <Files "*.js.gz"> ForceType application/x-javascript </Files> <Files "*.css.gz"> ForceType text/css </Files> <IfModule mod_mime.c> AddEncoding gzip .gz AddCharset utf-8 .js .css </IfModule> <IfModule mod_deflate.c> <IfModule mod_setenvif.c> SetEnvIfNoCase Request_URI "\.gz$" no-gzip </IfModule> </IfModule> <IfModule mod_headers.c> Header set Cache-Control "public, max-age=2592000" Header set Vary "Accept-Encoding" Header unset ETag </IfModule> # END BWP Minify Headers <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* - [E=ZIP_EXT:.gz] RewriteCond %{HTTP:Cache-Control} !no-cache RewriteCond %{HTTP:If-Modified-Since} !no-cache RewriteCond %{REQUEST_FILENAME}%{ENV:ZIP_EXT} -f RewriteRule (.*) $1%{ENV:ZIP_EXT} [L] RewriteRule ^minify-b(\d+)-([a-zA-Z0-9-_.]+)\.(css|js)$ /index.php?blog=$1&min_group=$2&min_type=$3 [L] </IfModule> # END BWP Minify Rules
Leave a Reply