gzip compress assets and images - #1884
Conversation
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
Do they still exist anywhere and should they now be removed? |
|
openhab/openhab-webui#2481 and openhab/openhab-webui#1432 was/is supposed to alter the webserver to deliver compressed files, when the browser announces support for these with The changes in openhab/openhab-webui#1521 were not sufficient to make openHAB deliver pre-compressed .js files. Is this change now delivering the compressed files, and:
|
|
The question was if the files are compressed on the fly. With openHAB 5.2.0 build 5227 my observation is that indeed many things are returned gziz-compressed, which previously used no compression. But HTML responses for
|
|
I think the best would be not to use a include list of paths and mime types, instead using an exclude list for mime types. So only some image types can get excluded. |
|
When I look in org.openhab.ui-5.2.0-SNAPSHOT.jar from openHAB built 5229 I see that app/assets/index-BC_AFnOV.js and app/assets/openhab-logo-BcJrHiEZ.svg are included three times: uncompressed, with If formats will be excluded, then In BasicUI the returned js/css files are not delivered compressed. Thinking on this again, it is actually fine to compress some data when MainUI/BasicUI are built, and deliver these files compressed to browsers. Everything else can be compressed on the fly, when the resource is requested, by a HTTP proxy between the internet and openHAB. (The latter does not work, if openHAB acts without a HTTP proxy, but is accessed from internet by using VPN). |
This PR will enable gzip compression for
/assets/*and/images/*with more mime types.In the past the precompressed files where used, but this is currently broken and a deprecated Jetty feature.
So i does not make sense for me to fix using the precompressed files, as the support has been removed in Jetty 10+.
Before the 5 MB javascript was not compressed:

Now the 5 MB file is compressed to 1.16 MB
