openhab / openhab-cloud

Cloud companion for openHAB instances
Eclipse Public License 2.0
314 stars 162 forks source link

Gzip compress traffic from https://demo.openhab.org #395

Closed dilyanpalauzov closed 1 year ago

dilyanpalauzov commented 1 year ago

Please enable compression for https://demo.openhab.org so that

curl --http2 -v -H "Accept-Encoding: gzip,deflate,br,zstd" -u demo:demo https://demo.openhab.org/css/app.css

returns compressed data.

As the server is nginx, gzip compression is enabled by adding

        gzip on;
        gzip_types text/css application/javascript;
        gzip_proxied any;

Rationale: on my OpenHAB home instance I have enabled gzip compression.

curl --http2 -v -H "Accept-Encoding: gzip,deflate,br,zstd" -u tarator:krastavica415OrEhi https://ip-addr/css/app.css

does return the compressed data. Firefox does send in the request Accept-Encoding: gzip, deflate, br, but does not show that the answer was compressed. It displays instead “Service worker”. I filled https://bugzilla.mozilla.org/show_bug.cgi?id=1796519 . Then I was asked to provide an example URL. Since I do not want to submit in public access to my private OpenHAB instance, it would be good if https://demo.openhab.org does return compressed data.

digitaldan commented 1 year ago

This is actually controlled by the openHAB server it self, which demo is always running the latest stable release. BR and GZ encoding was just added last week here https://github.com/openhab/openhab-webui/pull/1521 and here https://github.com/openhab/openhab-addons/pull/13559 , but won't show up on the demo server until 3.4 is released later this year. If you are running the latest nightly, gz and br encoding should be working. Let me know if thats not the case.

dilyanpalauzov commented 1 year ago

I filled your answer at https://bugzilla.mozilla.org/show_bug.cgi?id=1796519#c2 .

I have enabled gzip dynamic compression on my 3.3 instance by doing is on the Nginx proxy. The problem is however a need for a public server which does offer the compression.

digitaldan commented 1 year ago

The problem is however a need for a public server which does offer the compression.

As i mentioned, this will be released with our 3.4 release.