Tagged: Minify
- AuthorPosts
- June 26, 2023 at 8:03 am #94909Adam WolakGuest
W3 Cache The following minifiers cannot be found or are no longer working:
YUI Compressor (JS): JAVA executable path was not found.
echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64java -version
openjdk version “11.0.19” 2023-04-18
OpenJDK Runtime Environment (build 11.0.19+7-post-Ubuntu-0ubuntu120.04.1)
OpenJDK 64-Bit Server VM (build 11.0.19+7-post-Ubuntu-0ubuntu120.04.1, mixed mode, sharing)ls /usr/share/yui-compressor/yui-compressor.jar
/usr/share/yui-compressor/yui-compressor.jar<?php
namespace W3TCL\Minify;// Set the JAVA_HOME environment variable
putenv(“JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64”);// Set the YUI Compressor jar file path and temp directory
Minify_YUICompressor::$jarFile = ‘/usr/share/java/yui-compressor.jar’;
Minify_YUICompressor::$tempDir = ‘/var/www/skinclinic/tmp’;// Use YUI Compressor to minify the JS code
$code = Minify_YUICompressor::minifyJs(
$code,
array(‘nomunge’ => true, ‘line-break’ => 1000)
);June 26, 2023 at 8:10 am #95078Marko VasiljevicKeymasterHello Adam,
Thank you for reaching out and I am happy to assist you with this.
Can you please share the screenshot of the W3 Total Cache settings in Performance>Minify> JS section and please let me know if you had the YUI Compressor enabled before or have you just selected this option and the issue started to occur?
Thanks!June 26, 2023 at 11:36 am #95085Adam WolakGuestHello,
I just tried to enable it. So, I installed Java and YUICompressor and tried to anable it in W3 Total Cache.
Can not attach screenshot – so I am writing settingJS minify settings: Enable
Minify method: Combine & Minify
Minify engine settings:
Operations in areas:
Before </head>
After <body>
Preserved comment removal (not applied when combine only is active)
Line break removal (not safe, not applied when combine only is active)
HTTP/2 push EnableJune 26, 2023 at 11:44 am #95105Marko VasiljevicKeymasterHello Adam,
YOu can upload the images to imgur.com and share the link.
Thank you for the feedback.
Can you please also share what you added to the Path to JAVA executable: and Path to JAR file: and what message you are getting when clicking the Test YUI Compressor button?
Thanks!June 28, 2023 at 9:24 am #95248Adam WolakGuestHello,
I am sending you pictures of minify and browser cache.
Testing yuicompressor never ends.which java
/usr/bin/java/usr/share/yui-compressor/yui-compressor.jar
/usr/share/java/yuicompressor.jar – symlinkecho $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64On browser cache brottli can not be switched on (on server is anabled):
curl -I -H ‘Accept-Encoding: br’ https://bielskoclinic.pl
HTTP/2 200
server: nginx/1.18.0 (Ubuntu)
date: Tue, 27 Jun 2023 17:13:23 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
link: <https://bielskoclinic.pl/wp-json/>; rel=”https://api.w.org/”
link: <https://bielskoclinic.pl/wp-json/wp/v2/pages/611>; rel=”alternate”; type=”application/json”
link: <https://bielskoclinic.pl/>; rel=shortlink
link: </wp-content/cache/minify/d52ed.js>; rel=preload; as=script
link: </wp-content/cache/minify/3365a.js>; rel=preload; as=script
link: </wp-content/cache/minify/4c330.js>; rel=preload; as=script
link: </wp-content/cache/minify/d29e0.js>; rel=preload; as=script
link: </wp-content/cache/minify/0b78c.js>; rel=preload; as=script
link: </wp-content/cache/minify/cd429.js>; rel=preload; as=script
link: </wp-content/cache/minify/864c2.js>; rel=preload; as=script
link: </wp-content/cache/minify/86b7a.js>; rel=preload; as=script
link: </wp-content/cache/minify/1615d.js>; rel=preload; as=script
link: </wp-content/cache/minify/e0c07.js>; rel=preload; as=script
link: </wp-content/cache/minify/68002.css>; rel=preload; as=style
link: </wp-content/cache/minify/55947.css>; rel=preload; as=style
link: </wp-content/cache/minify/677d9.css>; rel=preload; as=style
link: </wp-content/cache/minify/87ad1.css>; rel=preload; as=style
last-modified: Tue, 27 Jun 2023 16:40:07 GMT
expires: Tue, 27 Jun 2023 17:40:07 GMT
pragma: public
cache-control: max-age=1604, public
etag: W/”23d3d2d12d1df0107e91bf84d070bec3″
x-powered-by: W3 Total Cache/2.3.3
link: <https://bielskoclinic.pl/wp-json/>; rel=”https://api.w.org/”
link: <https://bielskoclinic.pl/wp-json/wp/v2/pages/611>; rel=”alternate”; type=”application/json”
link: <https://bielskoclinic.pl/>; rel=shortlink
strict-transport-security: max-age=31536000; includeSubDomains
content-encoding: brJune 28, 2023 at 9:24 am #95351Adam WolakGuestI am sending 2 screenshots – one minify ans second with brotli witch is also not working
Server side:
which java
/usr/bin/java/usr/share/yui-compressor/yui-compressor.jar
/usr/share/java/yuicompressor.jar – symlinkecho $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64Brotli:
curl -I -H ‘Accept-Encoding: br’ https://bielskoclinic.pl
HTTP/2 200
server: nginx/1.18.0 (Ubuntu)
date: Wed, 28 Jun 2023 11:15:08 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
link: <https://bielskoclinic.pl/wp-json/>; rel=”https://api.w.org/”
link: <https://bielskoclinic.pl/wp-json/wp/v2/pages/611>; rel=”alternate”; type=”application/json”
link: <https://bielskoclinic.pl/>; rel=shortlink
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=script
link: <>; rel=preload; as=style
link: <>; rel=preload; as=style
link: <>; rel=preload; as=style
link: <>; rel=preload; as=style
last-modified: Wed, 28 Jun 2023 11:13:54 GMT
expires: Wed, 28 Jun 2023 12:13:54 GMT
pragma: public
cache-control: max-age=3526, public
etag: W/”b19af1add1d8fa85e2f75633c5e43e9b”
x-powered-by: W3 Total Cache/2.3.3
link: <https://bielskoclinic.pl/wp-json/>; rel=”https://api.w.org/”
link: <https://bielskoclinic.pl/wp-json/wp/v2/pages/611>; rel=”alternate”; type=”application/json”
link: <https://bielskoclinic.pl/>; rel=shortlink
strict-transport-security: max-age=31536000; includeSubDomains
content-encoding: brJune 28, 2023 at 12:19 pm #95376Marko VasiljevicKeymasterHello Adam,
Thank you for your feedback.
We need to replicate this and make sure that the paths are correct and the Java is installed correctly
I’ll get back to you once I have more details and am able to replicate the problem.
FOr the time being, you should use the default Minify option.
As for the Brotli, W3 Total Cache only recognizes the PHP extensions so please make sure that the https://github.com/kjdev/php-ext-brotli PHP brotli extension is installed on your server.Thanks!
June 29, 2023 at 10:20 am #95382Adam WolakGuesthttps://github.com/kjdev/php-ext-brotli is installed
#php -modules
[PHP Modules]
brotli
calendar
Core
ctype
curl
…June 30, 2023 at 12:29 pm #95644Adam WolakGuestHello,
did you solved problem?
Adam WolakJune 30, 2023 at 12:29 pm #95707Adam WolakGuestHello,
I soleved yuicompressor problem. Works fine – google says it is much faster 🙂
Only Brotli problem remains
Adam WolakJune 30, 2023 at 12:31 pm #95722Marko VasiljevicKeymasterHey Adam,
Thank you for your feedback.
It would be great if you could share what the problem was.
As for Brotli, please run the compatibility check in the W3TC dashboard and share the screenshot.
Thanks! - AuthorPosts
- The topic ‘YUI Compressor’ is closed to new replies.