www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - minifying the website

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
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
next sibling parent reply "w0rp" <devw0rp gmail.com> writes:
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
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
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
next sibling parent reply David Gileadi <gileadis NSPMgmail.com> writes:
On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :)
May 31 2013
next sibling parent "Simen Kjaeraas" <simen.kjaras gmail.com> writes:
On 2013-05-31, 19:47, David Gileadi wrote:

 On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :)
Certainly he would be weary, too? :p -- Simen
May 31 2013
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Friday, 31 May 2013 at 17:47:18 UTC, David Gileadi wrote:
 On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :)
I always thought people using "weary" were making some sort of joke I wasn't getting.....
May 31 2013
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 1:47 PM, David Gileadi wrote:
 On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"?
500K hits: https://www.google.com/#safe=off&output=search&sclient=psy-ab&q=%22i%27ve+been+weary+of%22&oq=%22i%27ve+been+weary+of%22&gs_l=hp.3...1121.4371.0.4641.20.18.0.0.0.0.265.4023.0j1j17.18.0...0.0...1c.1.15.psy-ab.OCbo1VhH_1U&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.47244034,d.bGE&fp=1c945b72c868c039&biw=1436&bih=813 4.33M hits: https://www.google.com/#safe=off&sclient=psy-ab&q=%22i%27ve+been+wary+of%22&oq=%22i%27ve+been+wary+of%22&gs_l=hp.3...5710.5710.1.5944.1.1.0.0.0.0.215.215.2-1.1.0...0.0...1c.1.15.psy-ab.q0Jhcs6ZPJ4&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.47244034,d.bGE&fp=1c945b72c868c039&biw=1436&bih=813 Guess you're right!
 Not meaning to pick on you, Andrei; it's just that this time was the
 tipping point for the editor in me to kick in :)
On the contrary I love being corrected. Andrei
May 31 2013
next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 31 May 2013 15:43:51 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail erdani.org> wrote:

 On 5/31/13 1:47 PM, David Gileadi wrote:
 On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"?
500K hits: https://www.google.com/#safe=off&output=search&sclient=psy-ab&q=%22i%27ve+been+weary+of%22&oq=%22i%27ve+been+weary+of%22&gs_l=hp.3...1121.4371.0.4641.20.18.0.0.0.0.265.4023.0j1j17.18.0...0.0...1c.1.15.psy-ab.OCbo1VhH_1U&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.47244034,d.bGE&fp=1c945b72c868c039&biw=1436&bih=813 4.33M hits: https://www.google.com/#safe=off&sclient=psy-ab&q=%22i%27ve+been+wary+of%22&oq=%22i%27ve+been+wary+of%22&gs_l=hp.3...5710.5710.1.5944.1.1.0.0.0.0.215.215.2-1.1.0...0.0...1c.1.15.psy-ab.q0Jhcs6ZPJ4&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.47244034,d.bGE&fp=1c945b72c868c039&biw=1436&bih=813 Guess you're right!
Actually, weary is not the correct term in this context at all, even if it doesn't win a google popularity contest ;) http://grammarstars.blogspot.com/2007/11/wearyleerywary-query.html -Steve
May 31 2013
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Fri, 31 May 2013 15:43:51 -0400
Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:

 On 5/31/13 1:47 PM, David Gileadi wrote:
 
 Not meaning to pick on you, Andrei; it's just that this time was the
 tipping point for the editor in me to kick in :)
On the contrary I love being corrected.
No you don't. (Couldn't resist ;) )
May 31 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 4:50 PM, Nick Sabalausky wrote:
 On Fri, 31 May 2013 15:43:51 -0400
 Andrei Alexandrescu<SeeWebsiteForEmail erdani.org>  wrote:

 On 5/31/13 1:47 PM, David Gileadi wrote:

 Not meaning to pick on you, Andrei; it's just that this time was the
 tipping point for the editor in me to kick in :)
On the contrary I love being corrected.
No you don't. (Couldn't resist ;) )
When I'm right I don't. Andrei
May 31 2013
parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Fri, 31 May 2013 17:24:38 -0400
Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:

 On 5/31/13 4:50 PM, Nick Sabalausky wrote:
 On Fri, 31 May 2013 15:43:51 -0400
 Andrei Alexandrescu<SeeWebsiteForEmail erdani.org>  wrote:

 On 5/31/13 1:47 PM, David Gileadi wrote:

 Not meaning to pick on you, Andrei; it's just that this time was
 the tipping point for the editor in me to kick in :)
On the contrary I love being corrected.
No you don't. (Couldn't resist ;) )
When I'm right I don't.
Just to be clear (not sure if it came across or not), I was [attempting to] make a joke about "Ahh, you love being corrected? Well then I'll be nice and correct you now! Enjoy, and you're welcome!" Really it's more contradiction than correction, but that's getting into argument clinic territory...
May 31 2013
next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, May 31, 2013 at 05:35:43PM -0400, Nick Sabalausky wrote:
 On Fri, 31 May 2013 17:24:38 -0400
 Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:
 
 On 5/31/13 4:50 PM, Nick Sabalausky wrote:
 On Fri, 31 May 2013 15:43:51 -0400
 Andrei Alexandrescu<SeeWebsiteForEmail erdani.org>  wrote:
[...]
 On the contrary I love being corrected.
No you don't. (Couldn't resist ;) )
When I'm right I don't.
Just to be clear (not sure if it came across or not), I was [attempting to] make a joke about "Ahh, you love being corrected? Well then I'll be nice and correct you now! Enjoy, and you're welcome!" Really it's more contradiction than correction, but that's getting into argument clinic territory...
I love self-contradictory / self-referential jokes... People say I'm indecisive, but I'm not sure about that. -- YHL, CONLANG People tell me that I'm skeptical, but I don't believe it. T -- People tell me that I'm paranoid, but they're just out to get me.
May 31 2013
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 6:53 PM, H. S. Teoh wrote:
 I love self-contradictory / self-referential jokes...

 	People say I'm indecisive, but I'm not sure about that.
 	-- YHL, CONLANG

 	People tell me that I'm skeptical, but I don't believe it.
Not to mention Obama's one: "My job is to be President; your job is to keep me humble. Frankly, I think I'm doing my job better." Andrei
May 31 2013
prev sibling next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 5:35 PM, Nick Sabalausky wrote:
 On Fri, 31 May 2013 17:24:38 -0400
 Andrei Alexandrescu<SeeWebsiteForEmail erdani.org>  wrote:

 On 5/31/13 4:50 PM, Nick Sabalausky wrote:
 On Fri, 31 May 2013 15:43:51 -0400
 Andrei Alexandrescu<SeeWebsiteForEmail erdani.org>   wrote:

 On 5/31/13 1:47 PM, David Gileadi wrote:

 Not meaning to pick on you, Andrei; it's just that this time was
 the tipping point for the editor in me to kick in :)
On the contrary I love being corrected.
No you don't. (Couldn't resist ;) )
When I'm right I don't.
Just to be clear (not sure if it came across or not), I was [attempting to] make a joke about "Ahh, you love being corrected? Well then I'll be nice and correct you now! Enjoy, and you're welcome!" Really it's more contradiction than correction, but that's getting into argument clinic territory...
Thanks, hadn't gotten the joke! Andrei
May 31 2013
prev sibling parent reply "Zach the Mystic" <reachzach gggggmail.com> writes:
On Friday, 31 May 2013 at 21:35:46 UTC, Nick Sabalausky wrote:
 Just to be clear (not sure if it came across or not), I was
 [attempting to] make a joke about "Ahh, you love being 
 corrected? Well
 then I'll be nice and correct you now! Enjoy, and you're 
 welcome!"
 Really it's more contradiction than correction, but that's 
 getting into
 argument clinic territory...
No it isn't.
May 31 2013
parent Russel Winder <russel winder.org.uk> writes:
On Sat, 2013-06-01 at 05:34 +0200, Zach the Mystic wrote:
 On Friday, 31 May 2013 at 21:35:46 UTC, Nick Sabalausky wrote:
 Just to be clear (not sure if it came across or not), I was
 [attempting to] make a joke about "Ahh, you love being=20
 corrected? Well
 then I'll be nice and correct you now! Enjoy, and you're=20
 welcome!"
 Really it's more contradiction than correction, but that's=20
 getting into
 argument clinic territory...
=20 No it isn't.
Is this a five minute argument, or the full half hour? http://www.montypython.net/scripts/argument.php --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 01 2013
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 5/31/2013 10:47 AM, David Gileadi wrote:
 On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :)
Weawy? Why awe you wagging on Awndway?
May 31 2013
parent "Tyro[17]" <ridimz yahoo.com> writes:
On 5/31/13 4:42 PM, Walter Bright wrote:
 On 5/31/2013 10:47 AM, David Gileadi wrote:
 On 5/31/13 10:26 AM, Andrei Alexandrescu wrote:
 ... I'm a bit weary of ...
I keep seeing people use this phrase; shouldn't it be "wary"? Not meaning to pick on you, Andrei; it's just that this time was the tipping point for the editor in me to kick in :)
Weawy? Why awe you wagging on Awndway?
Damn! Tweety... who let you out of your cage? -- Andrew Edwards -------------------- http://www.akeron.co auto getAddress() { string location = " ", period = "."; return ("info" ~ location ~ "afidem" ~ period ~ "org"); }
May 31 2013
prev sibling next sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Friday, 31 May 2013 at 17:26:16 UTC, Andrei Alexandrescu wrote:
 Thanks. I'm a bit weary of adding Java as a requirement for 
 building. Is that a legitimate concern?
I would add it as a separate make target, which is not needed for building the website, but is ran before uploading it to dlang.org. This way, website contributors won't need Java just to test their changes.
May 31 2013
prev sibling parent "Aleksandar Ruzicic" <aleksandar ruzicic.info> writes:
On Friday, 31 May 2013 at 17:26:16 UTC, Andrei Alexandrescu wrote:
 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
Well, some requirement must be added as I'm unaware of good minifiers that do not require a runtime. But I would always go with Node.js instead of Java. IMHO these days to be serious web developer you must have Node.js installed, as NPM modules have become de facto standard for distributing libraries and utilities for web development. For Node.js minifiers I recommend uglify.js (https://github.com/mishoo/UglifyJS2) for JavaScript and clean-css (https://github.com/GoalSmashers/clean-css) for CSS. And for server configuration take a look at https://github.com/h5bp/server-configs
May 31 2013
prev sibling next sibling parent "Brad Anderson" <eco gnuk.net> writes:
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
prev sibling next sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
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
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
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
next sibling parent "w0rp" <devw0rp gmail.com> writes:
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
prev sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Friday, 31 May 2013 at 17:23:49 UTC, Andrei Alexandrescu wrote:
 I don't know if the server is configured to serve them gzipped. 
 How do I figure that out?
I'd just upload a file.html.gz (gzip file.html on your own computer) and then try to go to dlang.org/file.html It might just work. If that doesn't, rename file.html.gz to file.html and again try it, if it just works, add gzip to your build process then upload. If it doesn't just work, and .htaccess is enabled, try adding this to your .htaccess file and then try again: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{HTTP_USER_AGENT} !Safari RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule ^(*.html)$ $1.gz [QSA,L] <FilesMatch \.html\.gz$> ForceType text/html Header append Vary Accept-Encoding </FilesMatch> </IfModule> <IfModule mod_mime.c> AddEncoding gzip .gz </IfModule> that just does html, the regexs will need matching for js and css too, but that should work. I use this on one of my computers to serve up file.html.gz as file.html transparently. BTW I suck at apache config and hate doing it (this is why my cgi.d has a gzip flag among others - easier to do in D than httpd.conf!) so if someone has a better way please overrule me.
 Can we count on all modern browsers to ask for gzipped content?
Yeah, and if not the server will most likely unzip it for you as needed.
May 31 2013
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 1:50 PM, Adam D. Ruppe wrote:
 I'd just upload a file.html.gz (gzip file.html on your own computer) and
 then try to go to dlang.org/file.html
It downloaded the file with name file.html. When opened with an editor, it showed the garbled compressed content.
 It might just work. If that doesn't, rename file.html.gz to file.html
 and again try it, if it just works, add gzip to your build process then
 upload.
This displays the same garbled compressed content straight in the browser.
 If it doesn't just work, and .htaccess is enabled, try adding this to
 your .htaccess file and then try again:
[snip] Tried, broke the directory. I recall our admin has disabled .htaccess. Andrei
May 31 2013
parent "Aleksandar Ruzicic" <aleksandar ruzicic.info> writes:
On Friday, 31 May 2013 at 19:51:29 UTC, Andrei Alexandrescu wrote:
 Tried, broke the directory. I recall our admin has disabled 
 .htaccess.


 Andrei
Which hosting company do you guys use? Disabling .htaccess seems too unprofessional.. Anyway, I was under impression that dlang.org is hosted from some dedicated server.
May 31 2013
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Fri, 31 May 2013 19:50:06 +0200
"Adam D. Ruppe" <destructionator gmail.com> wrote:
 
 BTW I suck at apache config and hate doing it
Me, too. I run Nginx on my server these days. One of the things I like about it is that its configuration is so much easier to deal with. It still isn't trivial, and I still have to think about what I'm doing, but it's not nearly as painful (for me, anyway) as Apache configuration.
May 31 2013
parent reply "Aleksandar Ruzicic" <aleksandar ruzicic.info> writes:
On Friday, 31 May 2013 at 21:00:05 UTC, Nick Sabalausky wrote:
 On Fri, 31 May 2013 19:50:06 +0200
 "Adam D. Ruppe" <destructionator gmail.com> wrote:
 
 BTW I suck at apache config and hate doing it
Me, too. I run Nginx on my server these days. One of the things I like about it is that its configuration is so much easier to deal with. It still isn't trivial, and I still have to think about what I'm doing, but it's not nearly as painful (for me, anyway) as Apache configuration.
+1 Couldn't agree more. I've switched to nginx few years back and haven't regretted it a bit.
May 31 2013
parent Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Fri, 31 May 2013 23:05:20 +0200
"Aleksandar Ruzicic" <aleksandar ruzicic.info> wrote:

 On Friday, 31 May 2013 at 21:00:05 UTC, Nick Sabalausky wrote:
 On Fri, 31 May 2013 19:50:06 +0200
 "Adam D. Ruppe" <destructionator gmail.com> wrote:
 
 BTW I suck at apache config and hate doing it
Me, too. I run Nginx on my server these days. One of the things I like about it is that its configuration is so much easier to deal with. It still isn't trivial, and I still have to think about what I'm doing, but it's not nearly as painful (for me, anyway) as Apache configuration.
+1 Couldn't agree more. I've switched to nginx few years back and haven't regretted it a bit.
Yea. The only downside I've heard people say about Nginx was that it was supposedly much lighter on features than Apache, but honestly, I don't see that at all. It seems to have all the bells & whistles I can think of ever needing.
May 31 2013
prev sibling next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
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
parent reply "Brad Anderson" <eco gnuk.net> writes:
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/
May 31 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 1:28 PM, Brad Anderson wrote:
 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/
Got similar results. Quite dramatic. So what should I tell our admin? Andrei
May 31 2013
parent "Brad Anderson" <eco gnuk.net> writes:
On Friday, 31 May 2013 at 17:33:15 UTC, Andrei Alexandrescu wrote:
 On 5/31/13 1:28 PM, Brad Anderson wrote:
 Ran it on http://dlang.org/

 http://www.webpagetest.org/result/130531_FM_d41bcc90232a08ecab128ed395047e63/
Got similar results. Quite dramatic. So what should I tell our admin? Andrei
He would need to install mod_pagespeed: https://developers.google.com/speed/pagespeed/module/download Do some typical Apache configuration (enabling the module for the Virtual Host and whatnot): https://developers.google.com/speed/pagespeed/module/configuration Just using the default CoreFilters is probably fine.
May 31 2013
prev sibling next sibling parent "w0rp" <devw0rp gmail.com> writes:
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
prev sibling next sibling parent reply "Mr. Anonymous" <mailnew4ster gmail.com> writes:
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
It would be also great if you could remove that flashing after the page is loaded. I believe it's caused by the bodyLoad() function. Why is it even needed?
May 31 2013
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/13 1:33 PM, Mr. Anonymous wrote:
 It would be also great if you could remove that flashing after the page
 is loaded.
 I believe it's caused by the bodyLoad() function. Why is it even needed?
Hyphenation. Andrei
May 31 2013
prev sibling next sibling parent reply "Wyatt" <wyatt.epp gmail.com> writes:
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.
I may be in the minority in this, but I would prefer if some of that were just removed entirely. In particular, the code-running doohickey that doesn't even work needs to die for the pathological behaviour it gives on Firefox. For example http://dlang.org/phobos/std_algorithm.html hung my browser for almost twenty seconds with a blank coloured background. This is on an i5 at work and my i7 at home, with or without extensions. I can't even imagine how my old laptop would cope. To add insult to injury, it displayed the page without the JS for almost a second before disappearing. I'm fine with some light JS that makes the documentation more usable or useful; this makes it practically unusable unless I have access to NoScript.
May 31 2013
next sibling parent "w0rp" <devw0rp gmail.com> writes:
On Friday, 31 May 2013 at 17:43:09 UTC, Wyatt wrote:
 I may be in the minority in this, but I would prefer if some of 
 that were just removed entirely.

 In particular, the code-running doohickey that doesn't even 
 work needs to die for the pathological behaviour it gives on 
 Firefox.  For example 
 http://dlang.org/phobos/std_algorithm.html hung my browser for 
 almost twenty seconds with a blank coloured background.  This 
 is on an i5 at work and my i7 at home, with or without 
 extensions.  I can't even imagine how my old laptop would cope.
  To add insult to injury, it displayed the page without the JS 
 for almost a second before disappearing.

 I'm fine with some light JS that makes the documentation more 
 usable or useful; this makes it practically unusable unless I 
 have access to NoScript.
I actually second this. I block those scripts because they slow the pages down massively, and often break. I'm using Firefox on Windows with a beefy i7.
May 31 2013
prev sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, May 31, 2013 at 07:43:08PM +0200, Wyatt wrote:
 On Friday, 31 May 2013 at 17:12:11 UTC, Andrei Alexandrescu wrote:
[...]
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.
I may be in the minority in this, but I would prefer if some of that were just removed entirely.
+1. I browse dlang.org with JS turned off because it's much more usable that way. I've no idea what the JS does (the only visible effect I can see is the ugly blob of unreadable links in the Phobos docs which are useless anyway -- the links, I mean, not the docs), but it makes page contents vanish for a good number of seconds, causes my browser to soak up memory like a sponge, and results in poor performance in general. We should either fix whatever is causing the performance hit, or just get rid of it altogether. [...]
 I'm fine with some light JS that makes the documentation more usable
 or useful; this makes it practically unusable unless I have access
 to NoScript.
Due to several sites that recently insisted on adding heavy-duty JS that doesn't add any significant functionality, I've turned off JS by default and only enable it on a site-by-site need-to basis (I use Opera that has per-site preferences built-in). The web is surprisingly faster and easier to use that way. (Most people will probably think I'm nuts, though. And they're probably right. :-P *shrug*) T -- In order to understand recursion you must first understand recursion.
May 31 2013
prev sibling parent "Kapps" <opantm2+spam gmail.com> writes:
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
The site currently isn't configured to serve gzip / deflate compressed content. Fixing this will lower bandwidth usage in a much more significant way than serving minified files would. I think mod_deflate is used for this in Apache.
May 31 2013