Even Faster Web Sites 171
Michael J. Ross writes "Slow Web page loading can discourage visitors to a site more than any other problem, regardless of how attractive or feature-rich the given site might be. Consequently, many Web developers hope to achieve faster response times using AJAX (Asynchronous JavaScript and XML), since only portion(s) of an AJAX page need to be reloaded. But for many rich Internet applications (RIAs), such potential performance gains can be lost as a result of non-optimized JavaScript, graphics, and CSS files. Steve Souders — a Web performance expert previously at Yahoo and now with Google — addresses these topics in his second book, Even Faster Web Sites: Performance Best Practices for Web Developers." Read on for the rest of Michael's review.
The book was published by O'Reilly Media on 18 June 2009, under the ISBN 978-0596522308. The publisher makes available a Web page, where visitors can purchase the print and electronic versions of the book (as well as a bundle of the two), read the book online as part of the Safari library service, and check the reported errata — comprising those confirmed by the author (of which there are currently two) and any unconfirmed errors (all six of which are valid, though the fifth one may be a coincidence). In a break with traditional practice among technical publishers nowadays, there is no sample chapter available, as of this writing.
Even Faster Web Sites | |
author | Steve Souders |
pages | 254 pages |
publisher | O'Reilly Media |
rating | 8/10 |
reviewer | Michael J. Ross |
ISBN | 978-0596522308 |
summary | Advanced techniques for improving website performance. |
In many ways, this second book is similar to Steve's previous one, High Performance Web Sites: It presents methods of enhancing the performance of websites, with a focus on client-side factors. It is fairly slender (this one is 254 pages), relative to most programming books nowadays, and the material is organized into 14 chapters. However, unlike its predecessor, Even Faster Web Sites emphasizes generally more advanced topics, such as script splitting, coupling, blocking, and chunking (which to non-developers may sound like a list of the more nefarious techniques in professional hockey). This second book also has employed a team approach to authorship, such that six of the chapters are written by contributing authors. In his preface, Steve notes that the 14 chapters are grouped into three broad areas: JavaScript performance (Chapters 1-7), network performance (Chapters 8-12), and browser performance (Chapters 13-14). The book concludes with an appendix in which he presents his favorite tools for performance analysis, organized into four types of applications: packet sniffers, Web development tools, performance analyzers, and some miscellaneous applications.
In the first chapter, "Understanding Ajax Performance," guest author Douglas Crockford briefly describe some of the key trade-offs and principles of optimizing applications, and how JavaScript now plays a pivotal role in that equation — as websites nowadays are designed to operate increasingly like desktop programs. On pages 2 and 3, he uses some figures to illustrate fixed versus variable overhead, and the dangers of attempting to optimize the wrong portions of one's code. By the way, the so-called "axes" are not axes, or even Cartesian grid lines, but simply levels. Aside from its choppy narrative style and a pointless religious reference in the first paragraph, the material serves as a thought-provoking springboard for what follows. Chapter 2, titled "Creating Responsive Web Applications," was written by Ben Galbraith and Dion Almaer, who discuss response times, user perception of them, techniques for measuring latency, browser threads, Web Workers, Google Gears, timers, and memory issues. The material is neatly explained, although Figure 2-2 is quite confusing; moreover, both of the figures on that page should not have been made Mac- and Firefox-specific.
In the subsequent four chapters, Steve dives into the critical topic of how to optimize the performance of JavaScript-heavy pages through better script content and organization — specifically, how and when to split up large scripts into smaller ones, how to load scripts without blocking one another or breaking dependencies within the code, and how to best in-line scripts, when called for. Each of the four chapters follows an effective methodology: The first author delineates a particular performance mistake made by even some of the most popular websites, with the statistics to back it up. He presents one or more solutions, including any relevant tools, again with waterfall charts illustrating how well the solutions work. Lastly, he explains any browser-specific issues, oftentimes with a handy chart showing which possible method would likely be optimal for the reader's given situation, such as expected browser choices in the site's target audience. When there are potential pitfalls, Steve points them out, with helpful workarounds. He generally provides enough example source code to allow any experienced developer to implement the proposed solutions. Unfortunately, the example code does not appear to be available for download from O'Reilly's website.
The discussion of JavaScript optimization is capped off by the seventh chapter, written by Nicholas C. Zakas, who explains variable scope within JavaScript code, the advantages of choosing local variables as much as possible, scope chain augmentation, the performance ramifications of the four major data types (literal values, variables, arrays, and objects), optimizing flow control statements, and string concatenation. He outlines what sorts of problems can cause the user's Web browser to freeze up, and the differing responses she would see depending upon her chosen browser. Nicholas concludes his chapter by explaining how to utilize timer code to force long-running scripts to yield, in order to avoid these problems. By the way, in Figures 7-2 and 7-3, the data point symbols need to be enlarged so as to be distinguishable; as it is, they are quite difficult to read. More importantly, on page 93, the sentence beginning "This makes array lookup ideal..." is either misworded or mistaken, since array lookup cannot be used for testing inclusion in ranges.
With the eighth chapter, the book shifts gears to focus on network considerations — namely, how to improve the site visitor's experience by optimizing the number of bytes that must be pushed down the wire. In "Scaling with Comet," Dylan Schiemann introduces an emerging set of techniques that Steve Souders describes as "an architecture that goes beyond Ajax to provide high-volume, low-latency communication for real-time applications such as chat and document collaboration" — specifically, by reducing the server-side resources per connection. In Chapter 9, Tony Gentilcore discusses a rather involved problem with using gzip compression — one that negatively impacts at least 15% of Internet users. Even though videos, podcasts, and other audiovisual files consume a lot of the Internet's bandwidth, images are still far more common on websites, and this alone is reason enough for Chapter 10, in which Stoyan Stefanov and Nicole Sullivan explain how to reduce the size of image files without degrading visible quality. They compare the most popular image formats, and also explain alpha transparency and the use of sprites. The only clear improvement that could be made to their presentation is on page 157, where the phrase "named /favicon.ico that sits in the web root" should instead read something like "usually named favicon.ico," since a favicon can have any filename, and can be located anywhere in a site's directory structure.
The lead author returns in Chapter 11, in which he explains how to best divide resources among multiple domains (termed "sharding"). In the subsequent chapter, "Flushing the Document Early," Steve explores the approach of utilizing chunked encoding in order to begin rendering the Web page before its full contents have been downloaded to the browser. The third and final section of the book, devoted to Web browser performance, consists of two chapters, both of whose titles neatly summarize their contents: "Using Iframes Sparingly" and "Simplifying CSS Selectors." That last chapter contains some performance tips that even some of the most experienced CSS wizards may have never heard of before. As with most of the earlier chapters, the narrative tends to be stronger than the illustrations. For instance, Figure 14-5, a multiline chart, is quite misleading, because it appears to depict three values varying over time, when actually each of the ten x-axis coordinates represents a separate major website. A bar chart would obviously have been a much better choice.
Like any first edition of a technical book, this one contains a number of errata (aside from those mentioned earlier): In Figure 1-1, "iteration" is misspelled. On page 23, in the sentence beginning "Thus, if...," the term "was" should instead read "were." In Figures 7-1 and 7-4, the "Global object" box should not contain "num2." On page 95, in the phrase "the terminal condition evaluates to true," that instead should read "false." On page 147, in the sentence beginning "However, the same icon...," the "was" should instead read "were." On page 214, "Web-Pagetest. AOL" should instead read "Web-Pagetest, then AOL," because the first sentence is one long absolute phrase (i.e., lacking a finite noun and verb).
All of these defects can be easily corrected in future printings. What will probably need to wait for a second edition, are improvements to the figures that are in need of replacement or clarification. What the publisher can rectify immediately — should the author and O'Reilly choose to do so — would be to make all of the example source code available for download.
Even though this book is decidedly longer than High Performance Web Sites, and has many more contributing authors, it does not appear to contain as much actionable information as his predecessor — at least for small- to medium-sized websites, which probably make up the majority of all sites on the Web. Even though such methodologies as Comet, Doloto, and Web Workers appear impressive, one has to wonder just how many real-world websites can justify the development and maintenance costs of implementing them, and whether their overhead could easily outweigh any possible benefits. Naturally, these are the sorts of questions that are best answered through equally hard-nosed experimentation — as exemplified by Steve Souders's admirable emphasis upon proving what techniques really work.
Fortunately, none of this detracts from the application development and optimization knowledge presented in the book. With its no-nonsense analysis of Internet performance hurdles, and balanced recommendations of the most promising solutions, Even Faster Web Sites truly delivers on its title's promise to help Web developers wring even more speed out of their websites.
Michael J. Ross is a freelance Web developer and writer.
You can purchase Even Faster Web Sites from amazon.com. Slashdot welcomes readers' book reviews — to see your own review here, read the book review guidelines, then visit the submission page.
SOMEONE buy a copy for the /. coders! (Score:5, Insightful)
Slashdot is the SLOWEST web site on the net.
Re: (Score:2, Flamebait)
the parent is about as useful a comment as saying "first."
Re: (Score:2, Informative)
Your post is not flamebait. One of the biggest drags with Slashdot and many others is the response time of constantly linking and loading off site ad servers before the main page shows itself, which is probably the intention. Doubleclick is especially horrible, and since I blocked it Slashdot loading has sped up very nicely. c.fsdn.com which seems to contain a lot of the "pretty widgets" is another real monster. Though I can read the page, blocking it breaks too much stuff. The quest for monetizing every li
Re: (Score:3, Interesting)
Re: (Score:2)
Then check out gopher...fast without lots of extra cruft. Here's a proxy [floodgap.com] dialup users can access. If you don't see what you're looking for, e-mail the maintainer and ask for it.
HTTP isn't the only game going...nor is it even the best game in town. Low bandwidth, high S/N ratio sites are out there. You just have to look for them.
Re: (Score:2)
Re: (Score:3, Interesting)
It's fast enough for me.
The CSS is horribly broken, but I have no complaints about the speed. Posting is certainly faster for me than it used to be before they switched to AJAX. It just looks like crap.
Re: (Score:2)
Posting is certainly faster for me than it used to be before they switched to AJAX. It just looks like crap.
Really? It takes AGES to preview a comment, I'm thinking 10-20 seconds, during which time you can't scroll down or do anything else (well you can, you'd just have to remember to scroll back up). At least with the vanilla html version you could open a new tab, and I don't remember having any issues with speed back then.
The rest of the site is great though - keyboard navigation for comments is something I really miss when on other sites now.
Re: (Score:2)
Yeah, that did occur to me afterward... you'd think I've have tried that before.
Re: (Score:2, Insightful)
"Classic" /. was always fast posting that I recall. I just wish I could have the features of the new /. (read: "the +/-" to meta-mod stories), with the old that was lost (read: ability to only display stories from certain sections, rather than only by author it seems now).
And maybe it's just me, but where is the option to not timeout your login? I don't want auto-login or to stay logged in after I close the browser (for security), but I hate that /. logs me out after only like 2 minutes of inactivity. I can
Re: (Score:2)
Re: (Score:2)
Re:SOMEONE buy a copy for the /. coders! (Score:5, Insightful)
Re: (Score:2)
Agreed. Also, it's slow.
Re: (Score:2)
Re: (Score:3, Informative)
It was faster before they added all the craptastic javascript everywhere.
See also "Anonymous Cowardon" (Score:2)
What I miss most is some kind of feedback corner - ok, sometimes the admins invite comments on new stuff, but those threads vanish too rapidly from the front page. Why not include a simple new slashbox named "Feedback" where people could notify the editors and administrators of things that bug them? This might also be an easy way to improve the site by pointing out common problems (spelling errors in submissio
"Preview Post" lag (Score:5, Interesting)
The only part that bothers me is the "Preview Post" lag lasting for 20-35 seconds. I love everything else about the navigation on the site, though.
Re: (Score:3, Informative)
That's the part where it port scans your computer to see if you're running an open proxy. Apparently everyone's considered untrustworthy regardless of current karma or account age.
Re: (Score:2)
I don't know how you can love it. Slashdot is one of the most awful web sites around. I come back for the community and the comments but really, especially for a community of highly opinionated geeks it's just pathetic.
For example, this very post page I am writing in fails to render correctly in Chrome, one of the most standards compliant browsers you can get. A simple thing, the "Reply to This" button with padding that overflows so it looks crap.
Apparently there is some whiz bang ajax interface for expa
Re: (Score:2)
Turn off javascript, it's actually usable then. Nothing worthwhile on the site actually uses javascript.
Re: (Score:2)
A couple of years ago Slashdot was bearable, especially as I could turn it to the "low tech" preference, which has now disappeared, and that even let me see it in my default font and not the sans font I do now. Now I have a later browser, twice as much RAM, and
Re: (Score:2)
It actually gets slower when you have mod points on some platforms (I can't say all as I don't use all). It can take a long time just to open the combobox choose how to mod the message, close the box, see it change, and get focus away from the box so when you try to scroll using the keyboard it doesn't change how you're modding the post. I think it is a problem with form efficiency in the browser: it just doesn't expect that many comboboxes to exist in a single form.
Then again, it may be just as slow to hav
Re: (Score:2)
Re: (Score:2)
No... (Score:4, Informative)
TLDR
WALL OF TEXT CRITS YOU FOR +5 TROLL
Re: (Score:3, Interesting)
I'd say the greatest barrier to website use is advertising, which isn't information; it's useless data. As to the book, AJAXing your site makes it slow. If you want a fast site, don't put anything on any page that doesn't absolutely need to be there, and have fast pipes and fast and enough servers.
If I see a really fancy layout on a web site, I always wonder why its developer thought the content was so bad that they needed to disguise it with slickness?
bing comes to mind. I've tried it quite a few times, an
Re: (Score:2)
BTW, shouldn't that be TLTR instead of TLDR? Oh, too long DIDN'T read. Gotcha. You wouldn't like most of my journals, or anybody's books.
"tl;dr" usually implies more than just the length of the text involved (although in some cases people are just that impatient). Usually it means that the writing either drags, or is just unnecessarily long for the message conveyed.
Re:No... (Score:4, Insightful)
Nonsense. Using Ajax can slow down a site, or it can speed it up immensely. It depends on how you use it. When GMail was first launched, everybody raved about how fast it was. That was the Ajax.
Assume you did that for Slashdot. You could then make further speed improvements by using Ajax in various places, for example so that it didn't reload a page full of hundreds of comments whenever you moderated.
Re: (Score:2)
Yes, if your site is like slashdot ajax could speed it up if done properly, but unfortunately most aren't like that. Any tool can be misused, and the webmastering community is really bad about jumping on the bandwagon using tools that just aren't appropriate for the task at hand.
I'm especially annoyed with sites that use javascript for a simple link. There are a few cases where that would be appropriate, but very few of the ones I've seen that use it are appropriate. If you right click one of these to open
Re: (Score:2)
When GMail was first launched, everybody raved about how fast it was. That was the Ajax.
So what happened? GMail definitely can't be classified as "fast" by any stretch of the imagination...
Re: (Score:2)
Yeah the more text in a web site or Slashdot story, the longer it takes to load.
Sometimes less is more. Learn to say more by using less text.
Turn off "Verbose" mode.
Re: (Score:3, Funny)
Too Long; Didn't Read [urbandictionary.com]
AJAX (Score:5, Insightful)
Re:AJAX (Score:4, Insightful)
Conversely, some of the fast websites use basic TEXT and skimp on the graphics.
I do websites for non-profits and I one of my rules in doing a website is NO UNNECESSARY graphics. Graphics that add pretties but don't add anything else are not allowed. I also run all the graphics through a size filter to limit unneeded pixel count and quality. You don't need 25MB photo on the front page; a scaled and reduced quality is a better choice.
My way of saying this is, "I don't need to see the pimples on the porn stars butt". Sometimes too much detail is too much.
Re: (Score:2)
>>>Conversely, some of the fast websites use basic TEXT and skimp on the graphics.
I concur. On my 50kbit/s dialup connection the sites that load fastest are the ones that resemble old 90s-era sites - just plain text and images. The slow ones are those sites that have to preload some javascript, flash, or other executable before they can display anything. Staring at a blank screen for 2 minutes is annoying.
>>>NO UNNECESSARY graphics. Graphics that add pretties but don't add anything else
Re: (Score:2)
Check this out ... http://web.forret.com/tools/megapixel.asp?width=3464&height=3464 [forret.com]
okay, so it isn't 25, it is 18MB (RAW). I would consider 7MB PNG to be overkill as well. Scale down, crop, and you can easily get it under 250k or even smaller.
Re: (Score:2)
That's not really true. Every image requires a separate http connection - which takes time to set up - and it has to be rendered and flowed, which takes time to do (depending on browser and processor speed etc).
Not even close. Ph
Re: (Score:2)
Generally if you compress a file that's already compressed, it gets bigger.
Then you're doing it wrong. To compress a JPEG to a lower size you would decrease the quality setting in whatever editing program you are using and reencode the picture. It's really not that hard.
Re: (Score:2)
That's not what i'm talking about. Nor what the GP was referring to. I'm talking about, for example, gzipping a jpeg file.
Re: (Score:2)
But that wasn't what commodore64_love was talking about. By recompressing the image he does mean that they recompress the image to a lower quality before sending it to the user.
Re: (Score:2)
Re: (Score:2)
Yes, I read what he's talking about and I've seen the compression he refers to in action. The ISP will re-render the images to a lower quality they aren't gzipping them.
Re: (Score:2)
Maybe. But it's not very common (not anywhere i've ever used dialup, anyway) and it produces ugly results.
V.42bis on-the-fly compression, which is handled by the modem, is considerably more common - and that recompresses image files, making the files bigger.
Re: (Score:2)
>>>[image compression is] not very common and it produces ugly results.
???. AOL has it. Netzero has it. Juno has it. Erols had it. Netscape has it. And you're right it produces ugly results, but if you're on dialup you're more-interested in speed than pretty pictures. Plus there's always the option to load the original image if, for example, you're viewing playboy.com. You don't have to use image compression.
>>>V.42bis on-the-fly compression, which is handled by the modem, is consi
Re: (Score:2)
None of those operate in any of the countries i've used dialup in.
I sincerely hope i never have to use dialup again (last time was the year before last in a remote part of Australia), but if i do, i'll stick to just turning off images in my browser. That's even faster.
Re: (Score:2)
Re: (Score:2)
>>>So compression means two things now? Damn kids
Yes. There's lossless compression where you take a text or executable file and squash it with ARC or ZIP. And then there's lossy compression where you take a photo and store it as a JPEG, or music and store it as MP2 or MP3. It's been that way for about twenty years now.... grandpa. ;-)
Re: (Score:2)
>>>>>To compress a JPEG to a lower size you would decrease the quality setting in whatever editing program you are using and reencode the picture.
>>That's not what i'm talking about. Nor what [commodore64_love] was referring to
Yes Will I was referring to that (adjusting the quality setting). You made the mistake of thinking the word "compression" meant lossless compression, but when my ISP squeezes a 100KB image to a 20KB image, they are using *lossy* compression.
Re: (Score:2)
>>>>>on slow connections virtually all dialup ISPs provide compression. So a 100 kilobyte photo would be squeezed to about 20 kilobyte before being sent over the phoneline... a mere 3 seconds.
>>Not even close. Photos are usually jpegs and therefore they're already compressed.
Bzzz. They are compressed, but they can still be compressed further. The ISP opens the JPEG or GIF image, resets the quality from 90 to 10* and then sends it over the phoneline. That's how an image can be compres
Re: (Score:2)
So a 100 kilobyte photo would be squeezed to about 20 kilobyte before being sent over the phoneline... a mere 3 seconds
Come again on that? You want to compress a compressed image by a factor of five?
Re: (Score:2)
You reencode the picture with lower quality settings.
Re: (Score:2)
Well, no, they usually don't re-encode images, they just compress, which, as my following poster WillKemp pointed out, would usually increase the file size of compressed images.
Well you and WillKemp are both wrong. Because by "recompress" he wasn't talking about gzipping it or anything like that. He was talking about them recompressing the JPEG image with lower quality settings. Just so you know, reencoding a JPEG file is "recompressing" it.
Re: (Score:3, Interesting)
Conversely, some of the fast websites use basic TEXT and skimp on the graphics.
As I said in another thread the other day: Whether or not you like his writing, I think Maddox hit the peak of usable web design: dark background, with large-font bright text. It's the easiest webpage on the internet to read, and despite having some graphics, it loads very quickly because he uses the graphics as actual content, not just filler.
Re: (Score:2)
No way man, websites designed like that have a persistence of vision effect that makes it extremely difficult to read any of the other windows on my computer for like 30 seconds. Poorest choice in web design. Now, I am all for using bigger fonts. Too many people are in denial about their need for glasses, so small fonts == lost customers.
Re: (Score:2)
Maddox says black text on a white background is like "Staring into a lightbulb". I never thought of it like that, but he makes a good point. Whe was the last time you saw a TV show display pure white background with black text on it?
Virtually never. The television world has learned the "friendliest" screen is a dark background (black, blue) with light-colored white test superimposed over it. Well computers use the same CRT or LCD technology as televisions. It makes sense to me they should follow the sa
Re: (Score:2)
He only really slowed down once he got a book deal, and started devoting his time to writing for pay. You can't really blame him; most college students who contribute to open-source projects find they have much less time and drive to do so after they get hired.
Re: (Score:2)
You might not, and I certainly don't, but I have a friend who's interests are exceptionally "backal" who'd probably appreciate that type of detail. Ugol's Law implies that there are at least a few people out there looking for that in their pr0n. Have you considered an alternate page that caters to them?
Re: (Score:2)
I agree.. For many years I had a very fast web site because everything was done in text. Now there's some graphics, but it still loads pretty fast. The problem is, there's all these new inventions, loading content that is not static, but computed, from a wide number of sites, each with several DNS lookups (multiple dns lookups slow down site view immensely). Too many web designers are paid by the hour, and tell their clients that they need to look 'modern' with whatever gadgets and eye candy is out there. M
Re: (Score:2)
Did I read what you said correctly? You're doing form input validation via AJAX? If so, you most certainly are correct in your initial assertion that you haven't been doing this very long.
Re:AJAX (Score:4, Insightful)
Re: (Score:2)
You're right, but it's not the AJAX that is the cause. It's the incompetent "web developers" who think AJAX is going to solve all of their problems....
Almost, but I would also lay the blame on the "when all you have is a hammer, all the world's a nail" developers who insist upon putting EVERYTHING into a database, because "that's how you make websites DUH LOL KTHXBYE". So every image, every bit of text, every CSS file, all require accessing a database, rather than a simple pull of a file.
Sure, you can have a database table that maps images to URLs, so that the code that IS accessing the database to build the page can find what URL to embed, and you can ch
What is a file system? (Score:2)
Sure, you can have a database table that maps images to URLs, so that the code that IS accessing the database to build the page can find what URL to embed, and you can change which image to use by altering the database table, but the ACTUAL IMAGE FETCH should be nothing more than pulling a file from the web server's file system. Nice, simple, and it allows the web server to correctly handle IF-MODIFIED-SINCE and Expires.
What is a file system, other than a database that maps paths to blobs?
Re: (Score:2)
The way most sites implement it, all AJAX does is offload the server's page-rendering load onto the user's CPU, because the developers are too lazy to write efficient server-side code.
There was a comment on that story a while back about the MJ death news slowing the entire web down, pointing out that Twitter crashed because some abysmally low number of requests per second overloaded it.
Cars won't end the world through an energy crisis, Web 2.0 developers will.
Re: (Score:2)
Oh, that's not what AJAX is for at all, though many morons may use it that way. endlesspage is a great example of what AJAX can be used for, allowing a faster page load/render time by delivering a screenful at first, then getting the additional pieces as the user scrolls. Or displaying information in response to user input, that is not needed for every page load. That is what it is for.
Template rendering via AJAX in the client is pure foolishness. If you have coded your backend properly, your app only g
Re: (Score:2)
And no technology can fix a bad coder who makes more than the minimum number of request calls.
Re: (Score:2)
i'm glad i'm not the only person that looked at XML and sat there scratching my head.. wondering why we need a solution to a non existing problem
So what are they saying to Slashdot with this... (Score:3, Insightful)
See slashdot, slow loading pages == bad.
I hope this book helps you.
Slow sites lose me (Score:5, Interesting)
Re: (Score:2)
This site below lost me way back. Click the link, wait 15 seconds. Yes, 15 seconds on a 50mbit connection. I wouldn't have waited that long on 56k.
One of my cores is running at 100%. 100% on a frigging webpage. I play 3D games on this 2-year-old laptop without maxing the CPU.
Scroll up and down and watch the page tear. Yes, tearing on a 2D webpage. What are they thinking?
The funny thing is though, the RSS feed has nice pictures, and full article text. They fail on so many levels.
http://www.tottenham [tottenhamhotspur.com]
Re: (Score:2)
The first thing to do... (Score:5, Informative)
...when your site is slow is to fire up YSlow [yahoo.com] and see what it says. Sometimes all you have to do is enable mod_expires in Apache to get a huge performance increase and a much lighter server load.
If YSlow doesn't flag anything, then you've got to start digging. But at least you've eliminated some of the easy fixes.
Re: (Score:2)
You probably already know this, but since it wasn't mentioned in the review: YSlow was also written by Steve Souders (the author of Even Faster Web Sites).
Running up the down escalator (Score:5, Interesting)
Were I to be developing a new AJAX-driven Web application I would focus first on simplicity. I feel that if you have so much AJAX stuff going on that you need to resort to crazy tricks you have already lost. Take the following, quoted from the review:
In the subsequent chapter, "Flushing the Document Early," Steve explores the approach of utilizing chunked encoding in order to begin rendering the Web page before its full contents have been downloaded to the browser.
While good advice, something like this should be implemented as a natural part of the specification, or not at all. This rings to me as an attempt to manhandle HTML/Javascript/CSS into a use case for which it is not intended.
I want to see a real protocol for webpages - something between Postscript (except less document-oriented; and yes I know about NeXT's work) and a windowing environment (except more constrained). Then, to preserve the ease of user-input, a simple HTML/XML-like layer. For 99% of the sites that are constructed directly by the user, original HTML with italics, colors, fonts, etc. is sufficient. For projects beyond the scope of Joe Facebook, a true system is needed that allows seperation of design and content. But all attempts thus far to do both, frankly, suck.
Re: (Score:2)
I completely agree with you, those technologies were not thought to be used like that. Thus, some effects are not directly possible and need serious hacking to be reached. HTML/Javascript/CSS are definitively not the right tool for what we are doing with it. The problem is that there is no tool/technology/language to replace it; and I can't see one coming.
I am taking here the risk to be modded troll. I do not believe in so called "web applications". If you need an application, just right a classical applica
No privileges to install an application (Score:2)
I do not believe in so called "web applications". If you need an application, just right a classical application that connects to remote servers.
Assuming "right" means "write": Your audience includes people who use a computer that they do not own and people who use lockout-chipped platforms such as Wii and iPhone. These people generally do not have the privilege to install such "a classical application".
We do not lack portable tool today. python is present on most (all?) operating systems.
Python does not come with Microsoft Windows, and non-administrators are not permitted to install a Python interpreter.
You can still even use java or .net
A Java program that does not require installation is called an applet, and web apps prior to widespread use of AJAX were often writt
Re: (Score:2)
if you have weird hardware issues,you are using a low level programming language which is clearly not required for the type of apps that are web based nowaday.
you can push a new version of the code at startup time. Since the software requires a server connexion, it is easy to send a new code/binary/resources/whatever at this time.
Re:Running up the down escalator (Score:5, Interesting)
>>>>>begin rendering the Web page before its full contents have been downloaded to the browser.
>>This rings to me as an attempt to manhandle HTML/Javascript/CSS into a use case for which it is not intended.
I disagree. Today's websites don't do it, but in the simpler 1990s era of pure HTML, the website DID render before completing download. The browser was expected to grab the HTML first, render the page with "X" placeholders, and then download the images last. That way the user could read the website even with the image only partially present.
So yes prerendering the webpage before download was completed *was* the original intent of the web. It is only lately that webpages have shifted away from that, and I for one would like to see them restore it.
Re: (Score:2)
Wait, no... reducing responsiveness is a feature. People go through a lot of trouble to prevent the infamous Flash of Unstyled Content.
Re: (Score:2)
While good advice, something like this should be implemented as a natural part of the specification, or not at all. This rings to me as an attempt to manhandle HTML/Javascript/CSS into a use case for which it is not intended.
HTML already does chunked loading. This is one of the big reasons you shouldn't use tables for layout. Since most tables are set to use auto layout, the browser has to wait for the table content before it can start rendering.
IE's subset of CSS doesn't like grids (Score:2)
This is one of the big reasons you shouldn't use tables for layout. Since most tables are set to use auto layout, the browser has to wait for the table content before it can start rendering.
But what's the widely compatible alternative? Some document layouts fit better into a grid model than a flow model. CSS supports grid layout (display: table, table-row, and table-cell), but the subset of CSS implemented in widely deployed versions of Windows Internet Explorer doesn't.
Re: (Score:2)
But what's the widely compatible alternative?
There isn't.
Well, that's not entirely true. You can use a handful of nested DIVs and another handful of CSS hacks to play nice with IE and get something very close to what used to work out-of-the-box with tables.
But wait, it gets worse! If you make the mistake of adding a valid DOCTYPE to your HTML, you can't even use tables for layouts (at least, not 100% height/width layouts).
HTML is a giant, festering boil of suck. You can't even just blame Microsoft; Mozil
Re: (Score:2)
When I use images, I make sure to provide the size parameters so the browser can display the page even if the images are still downloading.
Can't you do something similar with tables, such that the table can be displayed even if the content hasn't downloaded yet?
Wait a second... (Score:3, Insightful)
Slow Web page loading can discourage visitors to a site more than any other problem, regardless of how attractive or feature-rich the given site might be
Attractive and feature-rich are not adjectives that are appropriate to apply to slashdot it its current form. Hence I don't think this book is the cure to what ails them.
Or how about... (Score:5, Insightful)
When did simple, efficient web design that presents content well and doesn't get in the way of it get tossed out the window?
Re: (Score:2)
I completely agree with you. I am often browsing website on low powered device and sometimes with low bandwidth and it is so slow...
And there are website that can not be browsed if you do display images which you really don't want to do when you have a low bandwidth
webmasters, just strip the shit out of your pages !
Re:Or how about... (Score:4, Funny)
Most web sites do not need to be as ridiculously complicated to look so complicated. The web is relatively young, and AJAXification even younger. Give it time and common sense will prevail.
The semantic web, HTML5, and CSS3 will eventually usher in an era of peace and tranquility. Music will be free. Passwords will no longer be necessary. Web sites will design themselves to look different to everyone (like the alien in Contact looking like Jodie Foster's dad, or the talking taco pooping ice cream in South Park), appearing in a form with which the user feels most comfortable. Accessibility and affordance [wikipedia.org][wikipedia] will be implicit. Fluid design will exist in four dimensions, and tables will only be used for tabular data. JavaScript will be so unobtrusive it may never load, but that will be OK because all web sites will be semantic and thus 100% accessible and functional without it. And Noscript will no longer be needed on the browser because it will be installed at the ISP level...
Whoops. Sorry. I dozed off there but I kept typing while I was dreaming...
"Faster response times using AJAX" (Score:5, Funny)
I read this guy's other book, "Clearer thought using vodka". Great read. Can't remember much of it.
K.I.S.S. (Score:4, Insightful)
The fastest websites I see generally use plain-jane HTML and pre-sized graphics (via size attributes on IMG tag). AJAX, CSS, and too much JavaScript seem to cause confusing UI behavior, unexpected pausing while something fancy is doing GC, or jerky scroll motion that can be perceived as sluggishness, especially on older hardware.
Re: (Score:2)
I also wonder how much sluggishness is caused by putting everything in a database. I tried implementing a simple shopping-cart system for my website a while ago, where I have a very small handful of products I sell using Paypal buttons currently, and tried using some typical open-source packages like OScommerce. All of them make very heavy use of MySQL for every little thing: configuration settings, the actual content on each page, even images! This really seemed like overkill to me, and wasn't exactly f
It may not be a technical problem (Score:3, Insightful)
I've seen a lot of good sites "re-designed" into oblivion. I think it's mostly a social problem.
1. The "we're artistes" mentality. Unless your site is explicitly an art site (which it usually isn't), people will just want information from your site. You could do most of that with static HTML and a few simple images.
2. The "we're losing eyeballs, we need to do something" problem. The site design is an easy target; but it may not be your site design. Maybe your content is just boring. Competition moved in. You were participating in a fad. The honeymoon is over. The public tastes change. You can't control those things, but you can control your site design so that's what you do. It's like pushing the walk button at an intersection when somebody else has already pushed it.
3. Now, this is the one I really hate to say; but here goes... "You can't figure out how to let people go". The project is done. You need a few maintenance coders, the most experienced people. OK, maybe there's some justification for keeping staff around for new projects; but I bet often there isn't. If you're directly involved with the developers, you don't want to do this. The risk is that you'll spark brain-drain and cause the people you really need to leave. It's far less risky for you to keep everybody, even the grunts. Better yet, you can go up to the next level of management and tell them that site redesign is needed. That makes you the hero instead of the villain. The next level up from you is probably not going to figure out that you are just trying to keep your department busy. Perhaps this problem could be solved by making it clear right from the start that there will be a permanent staff and some contract workers. Instead, I bet there are a lot of companies where the web developers figured out how to justify their existance--to the detrement of the site, and the company.
4. Cool new technology. 'nuff said.
5. People just aren't that bright. They dynamicly generate javascript via a scripting language with a framework on top of it. Just to put "Hello World" on a page. Look at me! I'm a web developer.
Why is Google held in such high regard? (Score:2)
Google Mail is, hands down, *the* slowest webapp that I deal with. I'm not talking about the copout "basic HTML" option. I run any number of browsers (FF, Opera, Safari), and *all* take tens of seconds to load and interact with Google Mail. I dream about sharp needles in the eye as I wait for Google Mail to do its...magic.
So the author of this book is a "web performance expert" who is now employed by Google. Instead of writing books, maybe said author should figure out what's wrong with the Google Mail
This page takes six seconds to load. (Score:2)
This page takes six seconds to load. "data.coremetrics.com" is slow today. "c.fsdn" is slow, too. "doubleclick.com" only wasted about a second.
Maybe someone at Slashdot should read the book.
As he says, most sites need more simple advice (Score:3, Informative)
Efficient code? (Score:3, Insightful)
It's not your own content (Score:5, Insightful)
In my experience (having 20/5 Mbit fibre to the house) is that it's almost never the website's local content that loads slow, it's the damned ads. Let me say that again so that we're clear -- I'm sitting there waiting not for the content I was seeking to load, but for the ads that I don't want to load. I know there's work-arounds for this -- I use some of them and they do help. But Fred and Ethyl Nongeek is not going to know about ad suppression. To them the 'net is "just slow" and they don't know why.
Making your local content lightning fast isn't going to help if your customers are waiting for unwanted content from some other website. And (grrrr....) this includes CAPTCHA! Sometimes it takes almost a half minute for the captcha image to come up, long after the rest of the login page has loaded.
The worst example, and a sign of things to come, was when Google Ads went down awhile back and took a bunch of websites down with it, including (as I remember) Slashdot. If your page included google ads, it just wouldn't load. I don't think AJAX is going to help with that. Feel free to disagree, but be specific.
Re: (Score:2)
The worst example, and a sign of things to come, was when Google Ads went down awhile back and took a bunch of websites down with it, including (as I remember) Slashdot. If your page included google ads, it just wouldn't load. I don't think AJAX is going to help with that. Feel free to disagree, but be specific.
Well, it's kind of obvious: Ads should support loading through AJAX.
"We'll take your site down with us" is not a great selling point.
Slow websites ... (Score:2, Insightful)
Lousy Hosting = Biggest Problem (Score:2, Interesting)
Also, for instance try tallying up all of Facebook's JS, CS + HTML files, and you'll discover the site clocks in over 1MB. Now consider how fast the pages on the site load (super fast) See the difference how your site is hosted can make?
Google Talk: Speed Up Your JavaScript (Score:2)
http://www.youtube.com/watch?v=mHtdZgou0qU [youtube.com]