May 31, 2013 minifying the website | ||||
---|---|---|---|---|
| ||||
Hello, I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integrate with the build process. Alternatively, an online service could fit the bill, too. Thanks for your insights, Andrei |
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: > Hello, > > > I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. > > There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integrate with the build process. Alternatively, an online service could fit the bill, too. > > > Thanks for your insights, > > Andrei I recommend YUI Compressor. http://yui.github.io/yuicompressor/ I use it for compressing JavaScript and CSS at my job, and it works very well. (It's also part of a Maven build script at my job, which is also cool.) If you use it, I recommend --nomunge --preserve-semi --disable-optimizations so it doesn't do any JavaScript fiddling beyond just minification. |
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote: > Hello, > > > I've been looking through the logs and it looks like the top files in bytes transferred yesterday (even with the deluge of downloads) were a number of Javascript, HTML, and CSS files. > > There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integrate with the build process. Alternatively, an online service could fit the bill, too. > > > Thanks for your insights, > > Andrei mod_pagespeed can do all this and more on the server automatically. https://developers.google.com/speed/pagespeed/mod The filters it can apply: https://developers.google.com/speed/pagespeed/module/config_filters |
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote:
> There are programs to reduce the size of such files called "minifiers".
Are these files gzipped? gzipping them will almost certainly give a much bigger effect than any minifier and is trivially easy (in fact, it might be as simple as just gzipping the static file, and letting apache serve them straight up that way)
|
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | Andrei Alexandrescu: > There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integrate with the build process. Alternatively, an online service could fit the bill, too. Are those pages served gzipped? There is also this to test: https://developers.google.com/speed/pagespeed/service/tryit Bye, bearophile |
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 5/31/13 1:19 PM, Adam D. Ruppe wrote:
> On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote:
>> There are programs to reduce the size of such files called "minifiers".
>
> Are these files gzipped? gzipping them will almost certainly give a much
> bigger effect than any minifier and is trivially easy (in fact, it might
> be as simple as just gzipping the static file, and letting apache serve
> them straight up that way)
I don't know if the server is configured to serve them gzipped. How do I figure that out?
Can we count on all modern browsers to ask for gzipped content?
Andrei
|
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | Also, unless I'm mistaken, the dlang.org files don't appear to be gzipped. (Content-Encoding: gzip) Using gzip should massively reduce network IO. gzip works very well on HTML, JavaScript, JSON, and CSS, as there are a lot of redundant words used. |
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to w0rp | On 5/31/13 1:17 PM, w0rp wrote:
> I recommend YUI Compressor. http://yui.github.io/yuicompressor/ I use it
> for compressing JavaScript and CSS at my job, and it works very well.
> (It's also part of a Maven build script at my job, which is also cool.)
> If you use it, I recommend --nomunge --preserve-semi
> --disable-optimizations so it doesn't do any JavaScript fiddling beyond
> just minification.
Thanks. I'm a bit weary of adding Java as a requirement for building. Is that a legitimate concern?
Andrei
|
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Friday, 31 May 2013 at 17:23:49 UTC, Andrei Alexandrescu wrote:
> Can we count on all modern browsers to ask for gzipped content?
>
>
> Andrei
Browsers send Accept-Encoding headers to let the webserver know if gzip is viable, and webservers send gzip if they can, supposing they are configured to use gzip. All modern browsers should send the right headers, old ones will have fallbacks.
|
May 31, 2013 Re: minifying the website | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Friday, 31 May 2013 at 17:20:14 UTC, bearophile wrote: > Andrei Alexandrescu: > >> There are programs to reduce the size of such files called "minifiers". Should we use some? If so, what would the experts recommend? We'd need ideally some command line utility that we can deploy easily and integrate with the build process. Alternatively, an online service could fit the bill, too. > > Are those pages served gzipped? > > There is also this to test: > https://developers.google.com/speed/pagespeed/service/tryit > > Bye, > bearophile Ran it on http://dlang.org/ http://www.webpagetest.org/result/130531_FM_d41bcc90232a08ecab128ed395047e63/ |
Copyright © 1999-2021 by the D Language Foundation