xp-forge / frontend

Web frontends
1 stars 1 forks source link

If brotli extension is available, also compress to .br files #22

Closed thekid closed 3 years ago

thekid commented 3 years ago

See https://github.com/xp-forge/frontend/issues/21#issuecomment-822652962

File Uncompressed Gzip Brotli Delta
vendor.7b1f7cb.js 795.95 kB 229.87 kB 175.62 kB 54.25 kB
vendor.4d33b13.css 1330.04 kB 154.79 kB 115.12 kB 39.67 kB

When compressing both .gz and .br, runtime increased from 4.429 (for only compressing with gzip) to 10.893 seconds.

thekid commented 3 years ago

Pull request is basically OK, but there is a problem, because our current content negotiation mechanism will deliver the gzip filess with the typical Accept-encoding: gzip, deflate, br header sent by the client. As far as I currently understand, this header (without any q-values) means the client supports all and does not prefer any.

thekid commented 3 years ago

means the client supports all and does not prefer any.

"If there is no priority defined for the first two values, the order in the list is irrelevant.", says https://developer.mozilla.org/en-US/docs/Glossary/Quality_values