Speed Up Your AJAX With Google AJAX Libraries

Dion Almaer of Google and Ajaxian.com announced late last week the AJAX Libraries API. If you use AJAX, you’ll want to pay attention to this announcement. What does it mean?

Popular AJAX libraries including:

  • jQuery
  • prototype
  • script.aculo.us
  • MooTools
  • dojo

are now being hosted on Google’s servers for use on your site or applications. Why would you link to a file hosted on Google’s server? Because it is optimized for speed by providing the libraries in the following way:

  • Gzipped
  • Minified
  • Far future expires headers to increase caching
  • Delivered using Google’s extensive content delivery network

They are providing multiple versions of each library and even include a javascript loader for the libraries. For more on the benefits of this service, check out Steve Souder’s coverage and Dion’s extensive information on Ajaxian.

If you are using any of these AJAX libraries, you would be foolish not to seriously consider taking advantage of this service.

Speed Matters: Presentation Files and Resources

Speed Matters: Presentation and Resources

We had an exceptional audience tonight at DevGroup NW for my presentation on how to speed up web pages. There were a lot of good questions and an engaged audience. Thank you to everyone who showed up. Here is my presentation from tonight as well as some of the resources I mentioned.

The great irony is that I used so many images in my presentation that I can’t compress the pdf files to the degree that I would like. Sorry for the large file size. If it is any consolation, you’ll likely get to fully use your broadband connection unlike when you download web pages and are limited by current connections to a fraction of your connection speed. :-)

Books on Site Performance

Articles & Resources

Measuring Site Speed

Minimizers and Compressors

Statistics & Studies

Thanks to all of the Flickr users who posted their images with Creative Commons licenses. This presentation wouldn’t have been nearly as interesting without their photographs.

Logouts & Form-based HTTP Basic Authentication

There are many advantages to HTTP Basic Authentication, but despite these advantages, web developers have turned almost exclusively to using cookie-based authentication because of some limitations in how HTTP Basic Authentication can be implemented. Until recently, there has been no way to for developers to control the login form nor provide a way for users to log out.

The advantages of using HTTP Basic Authentication are easier integration. In particular, mod_auth_mysql for Apache makes it possible to easily password-protect areas based on usernames, passwords and roles stored in a central authentication database. The main alternative for authentication, cookie-based authentication, provides a higher barrier for integration projects.

Despite the integration advantages, most web developers use cookie-based authentication because they want to control the user experience of logging in. When logging in using HTTP Basic Authentication, the browser shows a login prompt. Developers have no control over the look of this login prompt; therefore, there is no ability to add useful information like links to retrieve forgotten passwords.
Continue reading “Logouts & Form-based HTTP Basic Authentication”

WYSIWYG Editor for Safari

A few years back I helped build a content management system. At the time, Internet Explorer on PC was the only browser we could use for WYSIWYG editing. As a Mac user, I struggled with the fact that I was delivering a product that I could never use on a regular basis.

At the time, the great promise was sections of the DOM II specification on range. Bugzilla listed support for this part of the specification on its future work. I signed up for a list and monitored the ticket waiting for the day when Mozilla would support WYSIWYG in-browser editing.

Today I read that the Yahoo UI team has finally bent Safari to its will to support WYSIWYG editing. We’ve come a long ways since I was hanging out on the Mozilla developer lists and asking questions about the range implementation. Now that someone has conquered Safari, we are close to assuming that this foundation piece of the read/write web is available to all users.

YUI Compressor, Web Site Speed

Via Ajaxian I learned the Yahoo has released a new javascript compressor that reduces file sizes 18%. Compression of web site code is something that too many web site developers ignore.

A few years ago, our CTO and I read Andrew King’s Speed Up Your Site book and became consumed with improving performance of our customer web sites. We decreased download time for one site by 75%. These changes prevented us from hitting our network capacity long enough to move to a new hosting facility where we weren’t constrained by bandwidth.

What amazes me is how frequently developers ignore the simple things that can be done to speed up their web applications. Most web servers contain options to supply their content in gzipped form. This option alone can save tremendous time for users and bandwidth costs for companies.

I have a short list of books that I wish everyone who develops online would take the time to read. Speed Up Your Site is near the top of that list.

P.S. I was pleased to find that my new hosting environment appears to be using gzip by default. The home page would be 19K uncompressed, but is delivered to the browser as a 4K gzipped file.

AJAX Prophesy

On February 26, 2005, I wrote my co-workers imploring them to read and grasp the significance of Jesse James Garrett’s article that coined the phrase AJAX. I recently stumbled upon this email and was pleased with how prophetic it turned out to be.

In retrospect, AJAX seems like an easy call, but at the time I wrote this, the phrase had just been coined and no one was certain how widely the technology would be adopted. In fact, I received push back from engineers that there was “nothing new here” and that they were doing this before with Perl-based web clients.

I’ve decided to post the email here for archival purposes and back date it to the time of my original email:

To: Staff
Subject: AJAX Web Development

As technology develops, it seems that there are seminal moments that describe and amplify a trend that has been percolating under the surface. Four years ago Jeffrey Zeldman wrote “To Hell with Web Browsers,” and with that declaration changed the way web developers everywhere, including Kavi, build sites.

What Zeldman proposed wasn’t anything new. The technological underpinning that he advocated had been around for years, and there had been a growing trend towards standards-based design prior to his call to arms.

What made Zeldman’s declaration significant wasn’t the ideas in it. Instead, he said the right thing at the right time. He coalesced many trends in web site development into a single, forceful argument for the standards-based web site development.

Why talk about this now? Because the day after the anniversary of Zeldman’s article, Jesse James Garrett wrote an article that I believe will mark another seminal point in web site development:
http://www.adaptivepath.com/publications/essays/archives/000385.php

The article carries many of the same characteristics. It describes existing technology (XMLHttpRequest) that has been around for a long time that has only recently begun to be looked at in a different light. Recent projects, particularly by Google, have illustrated how powerful this technology can be.

Take a look at Google Suggest (http://www.google.com/webhp?complete=1&hl=en) to see a web page auto-complete your search terms or try Google Maps and drag the map around with your cursor (http://maps.google.com/). And of course Gmail’s major appeal comes from it’s wonderful interface based on the same technology. In each case, the traditional web paradigm of the user making a change, submitting a form, and then waiting for the entire page to load has been replaced with nearly instantaneous feedback.

Garrett’s article gives this technology combination a name–AJAX which short for Asynchronous JavaScript + XML. His article marks the launching point for broader adoption of this technology. I expect to see many more web sites utilizing this technology combination over the next couple of years.

AJAX holds tremendous promise for our applications as well. Imagine auto-completion functionality when editing a company record and the time-savings it would give our customers who interact with our applications daily.

Four years ago, we could not have anticipated that the change advocated by Zeldman we be pervasive throughout the work that we do. Yet it has become a key part of what we do. And we have benefitted from adopting that philosophy.

AJAX holds that same promise. I encourage everyone who develops sites to read Garrett’s article. Keep your eye on this technology. I guarantee that you will see more of it in the future.

-Jason

References:

Ajax: A New Approach to Web Applications
http://www.adaptivepath.com/publications/essays/archives/000385.php

And Jeffrey said, “To Hell”
http://www.dashes.com/anil/2005/02/17/and_jeffrey_sai

To Hell With Bad Browswers
http://www.alistapart.com/articles/tohell/

XMLHttpRequest References
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
http://www.xml.com/lpt/a/2005/02/09/xml-http-request.html
http://developer.apple.com/internet/webcontent/iframe.html
http://www.oreillynet.com/lpt/a/1557

Examples of Ajax (XMLHttpRequest)
http://www.google.com/webhp?complete=1&hl=en
http://maps.google.com/
http://gmail.google.com/
http://www.a9.com/
http://blog.bitflux.ch/wiki/LiveSearch
http://www.basecamphq.com
http://www.tadalist.com
http://www.papermountain.org/demos/live/@JWanaRSVkJNJuQov/aHmKJgXs