James Wilson

Web developer. Drupal enthusiast. Surfer and musician. I craft bespoke websites at Bluespark.

Notes from Faster Frontend Drupal, Presentation by Matt Farina

Notes taken from presentation at DrupalCon given by Matt Farina. (Slideshare)

Slideshows for mobile?

Responsive Images

Remove image styles metadata

  • The ImageMagick advanced module has an option to strip out metadata/

Gzip Everything

  • mod_deflate (for Apache)
  • IIS (has Gzip built in)
  • HttpGzipModule (for nginx)

RoundTrip Time (RTT)

Length of time it takes to send a request and for it to come back.

CDNs

Mobile networks have 2 to 10x longer latency than wired connections.

Cut down on parallel connections:

  1. Use CSS Imagesprites.

  2. Enable CSS and JavaScript aggregation

  3. Adding an Expires header to components. Drupal 7 core does this already.

Go a step further and add it to scripts and stylesheets too. Use cache busting techniques like query string to force new downloads.

Warning: while desktop browsers have large caches, mobile browsers have a small cache.

Mobile Performance limitations

Javascript can take unto 10 times longer to execute on mobile.

  • 300 ms on desktop == 3 seconds on mobile!
  • 512 MB of ram on iPhone 4s (to help with battery life).
  • High end: 1gb of ram on iPad 2.

Mitigating Mobile Performance issues:

  1. Nothing fancy with JavaScript.

  2. !!!Simpler DOM!!! (cure divitis) A simpler dom has less objects in memory.

  3. Mobile Optimized Images, use responsive images, to use less ram to render.

Advanced concepts and configs

Use browser "local storage".

Minify HTML (htmlcompressor) hookpagedeliverycallbackalter, drupaldeliverhtml_page.

mod_pagespeed: Apachemodule to optimize web pages

Delayed JavaScript Evaluation: all js icnluded must be parsed and evaluated before it becomes avail. Jquery on iphone 4, takes 320ms to parse and evaluate. Lazy Evaluation waits until JS is needed to evaluate it.

Update Linux Kernel to 3.3 increases TCP initial congestion window to 10. This can cut down the number of round trips to get data: google and microsoft already do this.

Tools & Resources