[Ur] Pre-compressing static assets

Simon Van Casteren simon.van.casteren at gmail.com
Tue May 21 09:05:00 EDT 2019


Hey everybody,

I've been breaking my head today on how to do pre-compression of static
assets, mainly the app.*.js bundle. Currently I'm having Nginx do
on-the-fly compression using brotli at lvl 4. This causes my app.*.js
bundle to shrink from 1.8 MB to 145 kB. This is really good already, but
running it at lvl 11 gets me a 90 kB bundle, still 50% less than what I
have now! Running it at lvl 11 takes around 5 seconds (on my underpowered
server) though, which is really quite long.

In a normal situation I'd run the brotli compressor at build or deployment
time, but the app.*.js bundle is never on the filesystem, so I haven't
found a way to do this pre-compression in an Ur/Web context.

Anybody has any ideas?

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20190521/5468d068/attachment.html>


More information about the Ur mailing list