Slide 1

Slide 1 text

Building a University Website with RWD (Responsible Web Development) Erik Runyon | @erunyon | #PSUWeb12

Slide 2

Slide 2 text

who am i? Erik Runyon Manager of Interactive Development Wed Developer University of Notre Dame

Slide 3

Slide 3 text

i’m from here…

Slide 4

Slide 4 text

i work here…

Slide 5

Slide 5 text

only one of them plays…

Slide 6

Slide 6 text

we’re all #highered

Slide 7

Slide 7 text

we have a problem

Slide 8

Slide 8 text

news.cnet.com/2100-1038_3-5172107.html nytimes.com/2005/06/21/technology/21iht-broad.html flickr.com/photos/foolswisdom/108953458/lightbox/ Broadband began to overtake dial-up in 2004* * In major U.S. Cities

Slide 9

Slide 9 text

http://www.flickr.com/photos/specialkrb/4045683750/ dial-up 56Kbps edge 384Kbps 3g 1.2Mbps

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Erik’s personal Bermuda Triangle of AT&T suckage

Slide 14

Slide 14 text

http://www.websiteoptimization.com/speed/tweak/average-web-page/ http://www.webperformancetoday.com/2012/05/24/average-web-page-size-1-mb/ “Within the last eight years, the size of the average web page has more than septupled, and the number of external objects has more than tripled. While broadband users have experienced somewhat faster response times, dial-up users have been left behind.” - websiteoptimization.com (May 31, 2011) In the past 18 months, the average web page has grown by 50% — from 702 KB in November 2010 to 1042 KB on May 1, 2012. At this rate, the average page will hit 2 MB by 2015. - webperformancetoday.com (May 24, 2012)

Slide 15

Slide 15 text

averages for #highered RWD sites 16 sites sampled with iPhone UA and narrow screen (to simulate mobile) requests: 64 size: 1.4MB Sites used to generate these stats: http://bit.ly/highered-rwd

Slide 16

Slide 16 text

stand-outs University of California, San Diego ucsd.edu Lynn University lynn.edu 31 requests | 439kb 26 requests | 649kb http://notredame.photoshelter.com/gallery-image/2012-Graduate-School-Ceremony/G0000QHnZV6vbKHg/I0000S5ossz793xo

Slide 17

Slide 17 text

front-end

Slide 18

Slide 18 text

size matters

Slide 19

Slide 19 text

photos = jpg (~80% compression) graphics = png/svg (png8 if possible) NOT LOL’ing

Slide 20

Slide 20 text

ImageAlpha on transparent PNGs compress all images pngmini.com imageoptim.com

Slide 21

Slide 21 text

requests

Slide 22

Slide 22 text

Combine CSS/JS

Slide 23

Slide 23 text

Image Sprites

Slide 24

Slide 24 text

13 icons x 3 colors = 39 images or 39 icons combined = 7kb and 1 request

Slide 25

Slide 25 text

@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { .icn {background-image:url([email protected]); -moz-background-size:900px 1300px; -ie-background-size:900px 1300px; -o-background-size:900px 1300px; -webkit-background-size:900px 1300px; background-size:900px 1300px; } } http://bit.ly/JfHQOu

Slide 26

Slide 26 text

CSS at the top JS at the bottom

Slide 27

Slide 27 text

JS at the bottom http://developer.yahoo.com/performance/rules.html#js_bottom “While a script is downloading the browser won't start any other downloads, even on different hostnames.”

Slide 28

Slide 28 text

two exceptions

Slide 29

Slide 29 text

mobile first @mq

Slide 30

Slide 30 text

“The absence of support for @media queries is in fact the first @media query” @bryanrieger www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu

Slide 31

Slide 31 text

mobile first @mq 1. Global 2. Screen 3. @media queries as needed 4. Hi-res/retina specific 5. Print (yes, print)

Slide 32

Slide 32 text

progressive/on-request loading

Slide 33

Slide 33 text

One during load, two after everything else is done downloading

Slide 34

Slide 34 text

especially important here

Slide 35

Slide 35 text

server-side http://www.flickr.com/photos/40987321@N02/5580348753

Slide 36

Slide 36 text

Performance starts on the server Apache 1: mod_gzip Apache 2: mod_deflate Nginx: HttpGzipModule

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

http://bit.ly/PHPFeedCache

Slide 40

Slide 40 text

http://bit.ly/PHPFeedCache $cache = new FeedCache('local.xml','http://example.com/feed.xml'); $data = simplexml_load_string($cache->get_data()); /** * 1. If local file is valid, use it (defaults to 60 minutes) * 2. If it's not, try to cache it * 3. If that fails, use the local even if its expired */

Slide 41

Slide 41 text

RESS (responsive design + server-side components) lukew.com/ff/entry.asp?1392

Slide 42

Slide 42 text

RESS Tools http://www.flickr.com/photos/dipster1/1403240351/

Slide 43

Slide 43 text

http://www.flickr.com/photos/dipster1/1403240351/ WURFL: wurfl.sourceforge.net (free for non-commercial) 51degrees.mobi: 51degrees.mobi (free “Lite” version) Device Atlas: deviceatlas.com (pay service) OpenDDR: openddr.org (free)

Slide 44

Slide 44 text

UA-Parser/Detector github.com/tobie/ua-parser detector.dmolsen.com

Slide 45

Slide 45 text

UA-Parser github.com/tobie/ua-parser

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

isMobile; // return true if the browser met criteria of a mobile browser based on the user agent information print $result->isMobileDevice; // return true if the device met criteria of a mobile device based on the user agent information print $result->isTablet; // return true if the device was a tablet according to the user agent information print $result->isSpider; // return true if the device was a spider according to the user agent information print $result->isComputer; // return true if the device was a computer according to the user agent information print $result->isUIWebview; // return true if the user agent was from a uiwebview in iOS ?> UA-Parser

Slide 48

Slide 48 text

Detector detector.dmolsen.com

Slide 49

Slide 49 text

Detector uses Modernizer’s core tests to provide browser features on the server-side

Slide 50

Slide 50 text

so what?

Slide 51

Slide 51 text

touch device orientation/motion lowbandwidth (uses navigator.connection - Android 2.2+) copyright filamentgroupinc flickr.com/photos/filamentgroup/5149016958/

Slide 52

Slide 52 text

so what now?

Slide 53

Slide 53 text

customize the experience

Slide 54

Slide 54 text

let context dictate content

Slide 55

Slide 55 text

go a little crazy

Slide 56

Slide 56 text

erik runyon @erunyon weedygarden.net speakerdeck.com/u/erunyon