From simon.van.casteren at gmail.com Tue May 21 09:05:00 2019 From: simon.van.casteren at gmail.com (Simon Van Casteren) Date: Tue, 21 May 2019 15:05:00 +0200 Subject: [Ur] Pre-compressing static assets Message-ID: 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: From adamc at csail.mit.edu Tue May 21 11:34:46 2019 From: adamc at csail.mit.edu (Adam Chlipala) Date: Tue, 21 May 2019 11:34:46 -0400 Subject: [Ur] Pre-compressing static assets In-Reply-To: References: Message-ID: <37f9443e-0d2e-e6d4-ec83-e921e4fa3659@csail.mit.edu> I can't think of a good way to do it with Ur/Web as it stands. It should be a pretty simple tweak to the compiler to specify an external program to run to transform this JavaScript code. On 5/21/19 9:05 AM, Simon Van Casteren wrote: > 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 From simon.van.casteren at gmail.com Tue May 21 11:55:05 2019 From: simon.van.casteren at gmail.com (Simon Van Casteren) Date: Tue, 21 May 2019 17:55:05 +0200 Subject: [Ur] Pre-compressing static assets In-Reply-To: <37f9443e-0d2e-e6d4-ec83-e921e4fa3659@csail.mit.edu> References: <37f9443e-0d2e-e6d4-ec83-e921e4fa3659@csail.mit.edu> Message-ID: Alrighty, good to know. I'll put it on my list of stuff to do once I dig into the compiler. Thanks! Op di 21 mei 2019 om 17:36 schreef Adam Chlipala : > I can't think of a good way to do it with Ur/Web as it stands. It should > be a pretty simple tweak to the compiler to specify an external program > to run to transform this JavaScript code. > > On 5/21/19 9:05 AM, Simon Van Casteren wrote: > > 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 > > _______________________________________________ > Ur mailing list > Ur at impredicative.com > http://www.impredicative.com/cgi-bin/mailman/listinfo/ur > -------------- next part -------------- An HTML attachment was scrubbed... URL: