Nevermind. Looks like it isn’t working out of box (as Autoptimize does for example). Once I update the nginx settings it starts working just fine.
Hello @furioussnail
Thank you for the information. good thing I’ve refreshed the page as I was just about to suggest that.
In some cases, the Nginx needs to be updated.
Glad to know the issue is resolved!
Thanks!
Looks like that actually doesn’t really help. cache/minify/ is still empty. So, most likely the nginx rules simply do redirect to some sort of dynamic assets generation.
My best.
I have the following added to nginx:
# BEGIN W3TC Minify cache
location ~ /wp-content/cache/minify/.*js_gzip$ {
gzip off;
types {}
default_type application/x-javascript;
add_header Content-Encoding gzip;
expires 31536000s;
etag on;
if_modified_since exact;
add_header Referrer-Policy “no-referrer-when-downgrade”;
add_header Vary “Accept-Encoding”;
}
location ~ /wp-content/cache/minify/.*css_gzip$ {
gzip off;
types {}
default_type text/css;
add_header Content-Encoding gzip;
expires 31536000s;
etag on;
if_modified_since exact;
add_header Referrer-Policy “no-referrer-when-downgrade”;
add_header Vary “Accept-Encoding”;
}
# END W3TC Minify cache
and
# BEGIN W3TC Minify core
set $w3tc_enc “”;
if ($http_accept_encoding ~ gzip) {
set $w3tc_enc _gzip;
}
if (-f $request_filename$w3tc_enc) {
rewrite (.*) $1$w3tc_enc break;
}
rewrite ^/wp-content/cache/minify/ /index.php last;
# END W3TC Minify core
Tried to simplify thing and disabled the “Browser Cache”. Made sure to have the following in the nginx config files:
# BEGIN W3TC Minify core
set $w3tc_enc “”;
if (-f $request_filename$w3tc_enc) {
rewrite (.*) $1$w3tc_enc break;
}
rewrite ^/wp-content/cache/minify/ /index.php last;
# END W3TC Minify core
No minified assets are being generated.
Hello @furioussnail
Thank you for the information.
Can you please share the screenshot of the Performance>Minify? Do you have some .htaccess or Nginx conf file in /cache/minify/ folder?
Are you on Apache + Nginx environment and are you using a proxy? also can you please share your website URL?
Thanks!
In the end it looks like it was a configuration issue. All good now.
However, it looks like Autoptimize is better at minifying the assets. With W3 Total Cache Minify the assets are broken while I don’t encounter such an issue with Autoptimize.
Thank you.
Hello @furioussnail
Thank you for the information.
We are already working on improving the minify feature.
Thank you for your suggestion.
Another feature which would be quite nice is to minify and compress the assets but not combine them. That would help avoid breaking functionality in some cases while maintaining good performance with HTTP2 enabled.
Thank you.