• Make Fewer HTTP Requests
  • Use a Content Delivery Network
  • Add an Expires Header
  • Gzip Components
  • Put Stylesheets at the Top
  • Reduce DNS Lookups
  • Minify JavaScript
  • Optimize your Apache/Nginx config
  • Tune your database
  • ... and on, and on ...


So many things to work on! Where do I start?

(Performance) State of the Word

Where are we going? How are we doing?




Data for top 1000 WordPress sites (courtesy of Matt & team), circa mid 2012.

Load Time (s)



Min. 1st Qu. Median Mean 3rd Qu. Max.
0.385 6.419 11.940 14.480 19.760 61.020

11.9s to load the page and all associated assets

Time to First Paint (s)



Min. 1st Qu. Median Mean 3rd Qu. Max.
0.218 1.605 2.091 2.439 2.789 30.980

2.09s to first paint on screen

Number of Requests



Min. 1st Qu. Median Mean 3rd Qu. Max.
1.0 59.0 113.0 132.2 182.0 469.0

113 requests per page!

DNS Lookups



Min. 1st Qu. Median Mean 3rd Qu. Max.
1 20 30 38 49 147

113 connections, 30 distinct hosts

Total Kbytes downloaded



Min. 1st Qu. Median Mean 3rd Qu. Max.
0.2471 712.4 1409 1888 2532 9964

1409 kB per page load! (no cache)

A wordpress page takes...



  • 2.09s to first paint on screen
  • 11.9s to load all associated assets
  • 113 requests to assemble
  • 30 distinct DNS lookups
  • 1409 kB of data on first visit (no cache)



Consistent with general internet trends, but a bit higher across the board.

<drumroll>


And the winner is ... (hold on to your socks!)

Cache Score



Min. 1st Qu. Median Mean 3rd Qu. Max.
0.00 54.00 66.00 63.22 75.00 98.00

34% of assets not cached, but could be!

Cache score: % of static assets that had expires headers to enable browser caching

CDN Score



Min. 1st Qu. Median Mean 3rd Qu. Max.
0 55 67 64 78 98

33% of static assets could be served from a CDN

CDN score: % of static assets that were served from a CDN

GZIP Score



Min. 1st Qu. Median Mean 3rd Qu. Max.
0 96 100 95.62 100.00 100.00

Yay for GZIP!

GZIP score: % of text or js assets that were gzip encoded.

Image Compression Score



Min. 1st Qu. Median Mean 3rd Qu. Max.
0 68 80 77.01 90.00 100.00

20% of images are not compressed optimally

Image Compression Score: % of image objects that passed the image compression test.

Things to improve...



  • 34% of assets not cached, but could be
  • 33% of static assets could be served from a CDN
  • 20% of images are not compressed optimally



Top X lists are useful, but...





  • Your site is different
  • Your audience is different
  • Your goals are different
  • ...




Measure your users, on your site, with respect to your goals.

Google Analytics
Site Speed Reports
Segment by:
geo, browser, UA, ...

Case Study: igvita.com Server Response Time


GA > Content > Site Speed > Page Timings > Performance


Real User Measurement (RUM), for your site, available today - try it.



  • Histograms for all key performance metrics
  • Histograms per page, or site-wide
  • Advanced segments, custom reports, dashboards, ..., all for $0.00 / month

Performance insights for your site...



  • I need a CDN in Asia
  • Desktop users are doing well, really need to optimize mobile
  • Hmm, my server response time is slow!
  • My server is fine, but I need to optimize my frontend...
  • Users with faster load times view X more pages
  • ...



Measure first, optimize what matters to your site. Rinse, lather, repeat.

mod_pagespeed = Automagic Optimization



<VirtualHost *:80>
    ServerName www.my-WP-blog.com
    ...

    ModPagespeed on    /* Optimize my blog for me plz, kthnx */
</VirtualHost>

  • Open-source Apache module
  • On-the-fly content optimization and rewriting
  • Automatic image optimization and resizing
  • Automatic concatenation, inlining, ...
  • Above the fold optimizations

mod_pagespeed for Apache

Tweak, Configure, Customize



combine_css combine_javascript extend_cache
inline_css inline_import_to_link inline_javascript
rewrite_css rewrite_images rewrite_javascript
flatten_css_imports local_storage_cache recompress_images
inline_images resize_mobile_images insert_image_dimensions
convert_png_to_jpeg convert_jpeg_to_webp convert_jpeg_to_progressive
sprite_images collapse_whitespace rewrite_domains
defer_javascript lazyload_images inline_preview_images
... ... ...

Let's just say.. it does a lot! And we're always improving it. See our configuration instructions.

No optimization survives contact with the (real) user.


Automation is the answer. Ease of use, peace of mind.

Slides @ bit.ly/wordperf
  • Step 1: Determine terrain and direction
  • Step 2: Survey recommended routes
  • Step 3: Determine your route
  • Step 4: Optimize, automate (mod_pagespeed)
  • Step 5: See step 3

Fin. Questions?