OSCON 2006: Ajax Optimization Techniques

This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR.

Kevin Henrikson of Zimbra gave a brisk presentation covering some of the lessons his organization has learned and the “dirty tricks” it has implemented to improve the performance of web applications that rely on large JavaScript/CSS codebases. Here’s a quick run-down of the items he covered. The slides of the talk are up on the Zimbra blog.

First, a great tool for spotting problems: Web Page Analyzer will report on the relative sizes of the HTML, CSS, JavaScript, and images that make up any given page. Sometimes developers will work really hard to compress their images, only to serve hundreds of kilobytes of JavaScript code, and this tool will let you spot such issues in a hurry.

Kevin’s first piece of advice was not to be afraid to combine multiple files into a single file. This works for both JavaScript and CSS, and although it doesn’t cut down on the size of the data, it can significantly improve load time because browsers will only request a certain number of files at once.

As I’ve covered before, compressing JavaScript can be a tricky problem to solve. There are a lot of tools out there that are utter crap. But here are a few that work fairly well:

  • JSmin — aggressive, but doesn’t modify names
  • ShrinkSafe — less aggressive (more readable output), but reduces variable names
  • mod_gzip, mod_deflate — Apache modules that will compress web content before sending it to a browser that supports decompressing it

Once you’ve optimized your JavaScript (and other code), you should make sure that code is properly cached on the client side. The key here is to know your HTTP headers, and the best way to do that is to get a tool like Tamper Data, a Firefox extension that lets you analyze the HTTP requests and responses going on behind the scenes.

Kevin then went on to look at a couple of case studies he’s dealt with. The first centered around a high-profile blog post he wrote some seven months ago, AJAX and CSS Optimization, which criticized the newly-launched (at the time) version of Digg, the front end of which consisted of over 80% JavaScript code, which he managed to shrink significantly using the JavaScript compression tools mentioned above.

His second case study was lala.com, the HTTP caching of which is immaculate, but the site requires the browser to download so many files that load time is slowed down significantly by the limit on the number of simultaneous requests. This is readily apparent when viewing the request timeline for the site using a tool like Tamper Data.

Replay

Category: programming Time: 2006-07-27 Views: 2
Tags:

Related post

  • OSCON 2006: Cross-site Ajax 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Paralyzed by indecision (at any given time at OSCON, there are literally three different sessions I would consider "must-see" going on), I went to Plaxo developer Joseph Smarr's

  • OSCON 2006: Gettting Rich with PHP5 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. PHP's creator, Rasmus Lerdorf, gave a surprising talk on building PHP rich web applications using PHP5-suprising, because fully half the talk focused on low-level PHP optimization te

  • OSCON 2006: Cosmo and Scooby: Standards-Based Open Source Calendaring 2006-07-29

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Developed by the Open Source Applications Foundation (OSAF), Cosmo is a service enabling its users to put their personal information online and share it with others via open protocol

  • OSCON 2006: Rock-solid Web Development: Testing Web Apps 2006-07-26

    All this week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Presenter John Paul Ashenfelter provided the standard sales pitch for testing, but with a web development spin, and demonstrated both Selenium (a rich, in-browser testing framewo

  • OSCON 2006: Tim O'Reilly keynote 2006-07-27

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Kicking off the first day of open sessions at OSCON today, Tim O'Reilly gave his perspectives on the state of open source, and some of the big ideas currently making waves: Architect

  • OSCON 2006: Django: Web Development with Journalists' Deadlines 2006-07-27

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Lead developer Jacob Kaplan-Moss bills Django as a competitor to Ruby on Rails. Django is a web development framework that was born at a small community newspaper in the city of Lawr

  • OSCON 2006: Understanding ZFramework 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. John Coggeshall is a respected name in the PHP world, and works as a technical consultant for Zend, and provided a fast-paced introduction to the Zend Framework as it currently exist

  • OSCON 2006: Web Heresies: The Seaside Framework 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Avi Bryant has the dubious distinction of being one of the few web geeks with an avid interest in Smalltalk, and has created a web application development framework that suits his pa

  • OSCON 2006: No Flash Required: Interactive Browser Graphics 2006-07-29

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Gavin Doughtie has done stints in games development for Sony, web development for idealab, and software development for Picasa, but these days he works at DreamWorks Animation (yes,

  • OSCON 2006: Practical OpenID 2006-07-29

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. David Recordon (Six Apart, then Verisign) and Brian Ellin (JanRain) have had their fingers in OpenID since its inception. OpenID is an open user authentication system based on the pr

  • Windows 7 optimization technique 2013-09-28

    I am a system administrator for a corporation. Our marketing department has been complaining about computer performance. After looking into the complaints I discovered that they have to do with copying large video files to their computers. In Windows

  • What are the common rendering optimization techniques for the geometry pass in a deferred shading renderer? 2013-11-24

    I have been developing a game engine using OpenGL 3 and C++ (and glfw for window management). I have advanced so far, got most of the things done except sound entities and optimizations. The engine uses deferred shading so since deferred shading is i

  • OSCON 2006: TimeTravel Tables in PostgreSQL 2006-08-05

    A. Elein Mustain is a veteran developer of Ingres, Illustra, and Informix, and is the author of the weekly PostgreSQL General Bits column. Elein showed how to use timestamps to keep an audit trail of all changes in your DB. With this technique, you n

  • OSCON 2006: Rails Guidebook 2006-08-05

    Dave Thomas runs The Pragmatic Programmers company with Andy Hunt. He and Hunt co-authored The Pragmatic Programmer and Programming Ruby (AKA 'The Pickaxe Book'). Mike Clark is co-author of Agile Web Development with Rails, author of Pragmatic Projec

  • OSCON 2006: Big Bad PostgreSQL 2006-08-05

    Theo Schlossnagle is a principal at OmniTI Computer Consulting, working in the areas of scalable internet architectures, database replication, and e-mail infrastructure. This talk was on converting a really large (over 3 terabytes, largest table is 1

  • OSCON 2006: When Interface Design Attacks 2006-08-05

    Amy Hoy is the author of a Ruby on Rails- and design-oriented blog, Slash7. I was amazed to see how packed this session was. They propped the doors open, and people were actually standing around outside the door trying to listen. It was really good t

  • SQL Server - optimization techniques for rebuilding very large table 2012-10-01

    We generally use SQL Compare to generate upgrade/change scripts, and we also use the "Force column order" option by default. This basically means that the column order will be preserved going from database version A to B, so in situations where

  • PHP code optimization technique during echo statement 2016-01-19

    I am coding a php site from scratch. I am confused whether the following two codes are exactly same or are different with respect to server load and execution speed. Code 1: <ul> <?php $i =0; while($i < 10){ echo '<li>'.$row['database_da

  • OpenGL memory optimization and batching technique pitfalls 2015-02-17

    I'm studying OpenGL optimization techniques. What I'd like to achieve is to emulate as closely as possible Mantle/DirectX12 programming patterns (aggressive batching, flexible memory handling, complex pipelines) with current OpenGL API. The assumptio

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.894 (s). 13 q(s)