Websites on Speed

Philip S Tellis

Yahoo! Inc

Yahoo!7 Open Session • May 25, 2009 • Sydney, NSW, Australia

$ whoami

flickr:code_martial/1543735477

What's this talk all about?

flickr:justbecause/291874981

What's this talk all about?

flickr:justbecause/291874981

What's a website made of?

...

What's a website made of?

Where does the time go?

How do we speed it up?

How do we speed it up?

How do we speed it up?

How do we speed it up?

How do we speed it up?

How do we speed it up?

How do we speed it up?

1Fix it - reduce lookups & connections

flickr:swanksalot/2453794337

1Fix it - reduce lookups & connections

flickr:swanksalot/2453794337

1Fix it - reduce lookups & connections

flickr:swanksalot/2453794337

1Fix it - reduce lookups & connections

flickr:swanksalot/2453794337

1Fix it - reduce lookups & connections

Sample combo handler:

   $combo = preg_replace('/^.*\?/', '', $_SERVER['REQUEST_URI']);

   $sources = split('&', $combo);

   header('Content-type: text/javascript');

   foreach($sources as $source) {
           // TODO: Verify that $source is safe and exists
           include("/var/www/$source");
   }

1Fix it - reduce lookups & connections

1Fix it - reduce lookups & connections

1Fix it - reduce lookups & connections

1Fix it - reduce lookups & connections

   <Location /static>
      ExpiresActive On
      ExpiresDefault    "access plus 1 year"
   </Location>

1Fix it - reduce lookups & connections

2Fix it - be quick on the return

flickr:revdancatt/197037896

2Fix it - be quick on the return

flickr:revdancatt/197037896

2Fix it - be quick on the return

flickr:revdancatt/197037896

2Fix it - be quick on the return

flickr:revdancatt/197037896

2Fix it - be quick on the return

flickr:revdancatt/197037896

2Fix it - be quick on the return

Caching architecture

2Fix it - be quick on the return

2Fix it - be quick on the return

3Fix it - slim down

flickr:frosted_peppercorn/481102393

3Fix it - slim down

flickr:frosted_peppercorn/481102393

3Fix it - slim down

flickr:frosted_peppercorn/481102393

3Fix it - slim down

3Fix it - slim down

3Fix it - slim down

3Fix it - slim down

4Fix it - restructure pages

flickr:bluesmoon/867742899

4Fix it - restructure pages

flickr:bluesmoon/867742899

4Fix it - restructure pages

flickr:bluesmoon/867742899

4Fix it - restructure pages

4Fix it - restructure pages

4Fix it - restructure pages

5Fix it - cheat the DOM

flickr:matthewblack/2140930591

5Fix it - cheat the DOM

flickr:matthewblack/2140930591

5Fix it - cheat the DOM

flickr:matthewblack/2140930591

5Fix it - cheat the DOM

5Fix it - cheat the DOM

5Fix it - cheat the DOM

5Fix it - cheat the DOM

Old code:

    <div>
      <div>
        <input class="entry" name="larry">
        <input class="entry" name="curly">
      </div>
      <div>
        <input class="entry" name="moe">
      </div>
    </div>

5Fix it - cheat the DOM

New code:

    <ul>
      <li>
        <input class="entry" name="larry">
        <input class="entry" name="curly">
      </li>
      <li>
        <input class="entry" name="moe">
      </li>
    </ul>

5Fix it - cheat the DOM

5Fix it - cheat the DOM

5Fix it - cheat the DOM

6More tips

flickr:eagereyes/2624337393

6More tips

flickr:eagereyes/2624337393

6More tips

flickr:eagereyes/2624337393

6More tips

flickr:eagereyes/2624337393

6More tips

flickr:eagereyes/2624337393

6More tips

flickr:eagereyes/2624337393

6More tips

flickr:eagereyes/2624337393

YSlow

Tools

flickr:jeffwerner/329401643

Closing notes

flickr:thetaleoflight/3362048052

Closing notes

flickr:thetaleoflight/3362048052

Closing notes

flickr:thetaleoflight/3362048052

Closing notes

flickr:thetaleoflight/3362048052

Closing notes

flickr:thetaleoflight/3362048052

Credits

flickr:jackhynes/519904699

Photo Credits

flickr:25602112@N07/2539754489

Thank you

Made with Eric A Meyer's S5