SlideShare a Scribd company logo
The Server-side of
Responsive Design
Dave Olsen, @dmolsen
WVU University Relations - Web
Breaking Development, October 2013
“The Server-side?”
Was This Your First Reaction?

http://flic.kr/p/xdsh
“You’re a Smartphone Browser!”

http:/
/xkcd.com/869/
A Lot Riding on a Part of a Single String

One small piece of data.

Assumptions
The Responsive Age
Responsive Design

vs. Server-side
http://flic.kr/p/6JVLMd
Why Be Responsive?

One...

http://flic.kr/p/5pGcyx
Why Be Responsive?

One...
URL.
Set of content.
Set of mark-up.
Deployment.
We Have to Be futurefriend.ly
Time to Party!

balloons

http://flic.kr/p/h6McT
“Not so fast, my friends...”

http://flic.kr/p/8x6b8X
© Brad Frost

brad’s iceberg
© Brad Frost

brad’s iceberg
False Sense of Security?

This shit can be complicated.

Assumptions
Maybe it’s not so simple...

Responsive Design

vs. Server-side
http://flic.kr/p/6JVLMd
Maybe instead it could be...

Responsive Design

&

Server-side

http://flic.kr/p/6JVLMd
A New Hope?

Especially if we can be
future-friendly on
the server-side too.
The Server Side of Responsive Web Design
http://flic.kr/p/agyEkb
How do we combine them?
What is RESS?

RESS
Responsive Web Design +
Server Side Components
I have no idea what becomes of the W, D, or C
What is RESS?

In a nutshell, RESS combines
adaptive layouts with server
side component (not full page)
optimization.
- Luke Wroblewski
@lukew
http:/
/www.lukew.com/ff/entry.asp?1392
What is RESS?

Swap HTML components (from
those avail on server) in a RWD
to further optimize page/app.
- Luke Wroblewski
@lukew
https:/
/twitter.com/lukew/status/275678033661272064
Responsive Design is Our Baseline

http://flic.kr/p/9UmsCJ
To Be Absolutely Clear

Server-side components
are an enhancement.
Provide the good default/fallback with “RE” and
optimize the experience with “SS”.
Server-side Swapping...

Simple Example: Swapping an Image

Mobile View

Desktop View

http://www.lukew.com/ff/entry.asp?1392
Server-side Swapping...

Simple Example: Swapping an Image

index.html
userimg.html
mobile_userimg.html

http:/
/www.lukew.com/ff/entry.asp?1392
Server-side Swapping...

Simple Example: Swapping an Image

<img class="userimage" width="50" height="50"
alt="{{ username }}" src="{{ smluserimg }}">

<img class="biguserimage" height="300" width="300"
alt="{{ username }}" src="{{ biguserimg }}">

http:/
/www.lukew.com/ff/entry.asp?1392
Ultimately, RESS is a Scalpel
MOBILE WEB

TABLET WEB

DESKTOP WEB

It’s All One Web
When Does RESS Make Sense?

http://flic.kr/p/b6WaSP
RESS Works Well If...

• If you want layout adjustments across devices.
• And optimization at the component level to
increase performance or tune user experience.
• You trust server-side device detection with
sensible defaults.
- Luke Wroblewski
@lukew
http:/
/www.lukew.com/ff/entry.asp?1509
My Experience On When It Makes Sense

• Team has a mix of skills.
• Team members are not strong in the
skills necessary for complex RWD
interactions.
• Design elements need to be
swapped based on known
functionality or performance issues.
RESS Works Well If...

1.5 MB
The average weight of a home page today.

Source: HTTP Archive

CSS

77%

HTML

JavaScript Other

Flash

Images
It’s a Tool in the Toolbox
RESS Can Be A Bridge

http:/
/flic.kr/p/7FyCB2
How Do We Implement RESS?

So how would we implement?

http://flic.kr/p/5ATc7g
Skipping Responsive Design...

Responsive Web Design is “easy”

http://flic.kr/p/4YM8
Two Types of RESS

#1 Server-side Driven
#2 Client-side Driven
Two Types of RESS

#1 Server-side Driven
Two Possible Solutions

Server-side
Solutions
http://flic.kr/p/9jatna
Two Server-Side Options

#1 Browser Detection
Been Around a Long Time

Old dog

http://flic.kr/p/bWQicm
It’s Used A Lot

82% of the Alexa 100 top sites use
some form of server-side mobile
device detection to serve content on
their main website entry point.
- Ronan Cremin
@xbs

http://www.circleid.com/posts/20120111_analysis_of_server_side_mobile_web_detection/
There Are Robust Solutions

ScientiaMobile
DeviceAtlas
51Degrees.mobi
A Word About Open Source
Is it an Arms Race?

http://flic.kr/p/6RVLY2
Is it an Arms Race?

Yes, but so is everything
in web development.
just look at the Modernizr issue tracker
Two Server-Side Options

#2 Server-side Feature Detection
Implementations Are In Their Infancy...

Infancy

http://flic.kr/p/7B7uyp
The Idea Has Been Around for Awhile

http://flic.kr/p/d34hh3
Taking a Cue From Front-end Dev
Modernizr Server
Can the Server Be Future-Friendly?
Server-side Feature Detection Options

#1 Server-side Breakpoints
#1: Server-side Breakpoints

320px

640px

960px
#1: Server-side Breakpoints

Simple Example:
Setting a file path based on window.innerWidth
<script type="text/javascript">
function writeCookie(name, value) {
//cookie code
}
// store the innerWidth of the window in a cookie
writeCookie("RESS", window.innerWidth);
</script>

http:/
/www.netmagazine.com/tutorials/getting-started-ress
#1: Server-side Breakpoints

Simple Example:
Setting a file path based on window.innerWidth
<?php
// grab the cookie value
$screenWidth = $_COOKIE[‘RESS’];
// set the img path var
if ($screenWidth <= 320) {
$imgPath = “320”;
} else if ($screenWidth < 960) {
$imgPath = “640”;
} else {
$imgPath = “960”;
}
// print out our image link
print “<img src=‘/rwd/images/”.$imgPath.”/car.jpg’ alt=‘Car’ />”;
?>

http:/
/www.netmagazine.com/tutorials/getting-started-ress
Server-side Feature Detection Options

#2 Robust Feature Detection
#2: Robust Feature Detection

...feature tests should only
ever be run when you don’t
know the UA you’re running in.
- Alex Russell, Jan. 2011
@slightlylate

http:/
/infrequently.org/2011/01/cutting-the-interrogation-short/
#2: Robust Feature Detection
#2: Robust Feature Detection

Simple Example: Inserting a video link
<?php
// require Detector to identify browser & populate $ua
require("lib/Detector/Detector.php");
$html5Embed = "<iframe {...} ></iframe>";
$simpleLink = "Your browser doesn't appear to support HTML5. {...}";

!
!
!

// use the $ua properties to switch
if ($ua->video->h264 || $ua->video->webm) {
print $html5Embed;
} else {
print $simpleLink;
}

?>

http:/
/detector.dmolsen.com/demo/ytembed/
#2: Robust Feature Detection

Complicated Example:
Templates Using Detector & Mustache

http:/
/ress.dmolsen.com/
MOBILE BASIC

M-ADVANCED

DESKTOP WEB

ress.dmolsen.com
Example: West Virginia University
Example: West Virginia University
Goals/Issues:

• Modifying the carousel for retina & code
• Modify mark-up for IE 7 & 8
• Provide a non-responsive baseline
• Deliver the “correct” mark-up
• Fast turnaround
Implementation:

• Detector for classification
• Mustache for templates
• YAML for data storage
Example: West Virginia University

Hybrid Example: Mixing Types of Detection
{
{
"mobile-advanced-ie": {
"isMobile": true,
"browser": "IE Mobile"
},
"mobile-advanced-retina": {
"isMobile": true,
"hirescapable": true
},
"mobile-advanced": {
"isMobile": true,
"features": [ "csstransforms" ]
},
"mobile-basic": {
"isMobile": true
},
"ie": {
"browser": "IE",
"major": "7||8"
}
}
MOBILE BASIC

M-ADVANCED

DESKTOP WEB

wvu.edu
Example: West Virginia University
700K

700K

700K

700K

525K

525K

525K

525K

350K

350K

350K

350K

175K

175K

175K

175K

0K

Total Images JS

CSS HTML

Default

0K

Total Images JS

CSS HTML

Mobile
Retina

0K

Total Images JS

CSS HTML

Mobile
Advanced

0K

Total Images JS

CSS HTML

Mobile
Basic
Example: West Virginia University
100%

75%

50%

25%

0%
2011

2012

2013

Mobile Traffic on First Day of Fall Semester
Two Types of RESS

#2 Client-side Driven
Client-side: Cutting the Mustard
Client-side Example: An Event Apart
Client-side Example: An Event Apart

Example: Fetching Content by Breakpoint
$(window).bind(“enterBreakpoint600”, function () {
if (bigLoaded == false) {
if ($("#slide-show").length > 0) {
$("#slide-show").load("/main/heroes",
function () {
...
});
};
};
});
$(window).bind(“enterBreakpoint1”, function () {
if (smallLoaded == false) {
$("#event-thumbnail-holder").load("/main/small-heroes",
function () {
...
});
};
});
source bastardized from http://aneventapart.com
Client-side Example: An Event Apart
LESS THAN 600PX

600PX+

aneventapart.com
Client-side Example: An Event Apart
500K

500K

375K

375K

250K

250K

125K

125K

0K

Total

Images

JS

CSS

HTML

XHR

Fonts

Greater than 600px

0K

Total

Images

JS

CSS

HTML

XHR

Fonts

Less than 600px

They get bonus points for also using lazy loading.
Challenges for RESS

http://flic.kr/p/9wF2S
Challenges for RESS

RESS isn’t a silver bullet.
anymore than RWD is
Challenges for RESS

Server-side feature detection
can be spoofed.
Challenges for RESS

Requires server-side languages.
if you go the server-side route
Challenges for RESS

Data needs to be strongly
separated from layout.
Challenges for RESS

Need to properly set
cache headers.
Are Client-Hints the Future of RESS?
http://flic.kr/p/c74N1
The Server Side of Responsive Web Design
http://flic.kr/p/agyEkb
Questions or comments?
Thanks for Listening

Dave Olsen
Professional Technologist
West Virginia University

@dmolsen
dmolsen.com

More Related Content

PDF
Responsive Design Workflow (Breaking Development Conference 2012 Orlando)
PDF
Style Guides Are The New Photoshop (Fronteers 2012)
PDF
Responsive Design Workflow: Mobilism 2012
PDF
Brad frost: Atomic design (Webdagene 2014)
PDF
The Death of Lorem Ipsum & Pixel Perfect Content
PDF
Atomic Design - An Event Apart San Diego
PDF
Atomic Design - BDConf Nashville, 2013
PDF
Beyond Squishy: The Principles of Adaptive Design
Responsive Design Workflow (Breaking Development Conference 2012 Orlando)
Style Guides Are The New Photoshop (Fronteers 2012)
Responsive Design Workflow: Mobilism 2012
Brad frost: Atomic design (Webdagene 2014)
The Death of Lorem Ipsum & Pixel Perfect Content
Atomic Design - An Event Apart San Diego
Atomic Design - BDConf Nashville, 2013
Beyond Squishy: The Principles of Adaptive Design

What's hot (20)

PDF
React Storybook, Atomic Design, and ITCSS
PPTX
Responsive Design Workflow
PDF
Atomic Design con Pattern Lab
PDF
Responsive Design Workflow: Webshaped 2012
PDF
RESS: An Evolution of Responsive Web Design
PDF
Building the Media Block in ReactJS
PDF
Data science for infrastructure dev week 2022
PDF
MIMA 2014 - Changing your Responsive Design Workflow
PDF
Atomic design
PDF
ACSS: Rethinking CSS Best Practices
PDF
Style Guides Are The New Photoshop (Smashing Conference 2012)
PDF
Responsive webdesign
PDF
Adventures in Atomic Design
PDF
Voorhoede - Front-end architecture
PDF
Creating Style Guides with Modularity in Mind
PPTX
Atomic design React Nova Presentation
PPTX
An introduction to Emulsify
PDF
Responsive Web Design: Clever Tips and Techniques
PDF
The Death of Lorem Ipsum and Pixel-Perfect Content (MinneWebCon version)
PPTX
Web Standards And Protocols
React Storybook, Atomic Design, and ITCSS
Responsive Design Workflow
Atomic Design con Pattern Lab
Responsive Design Workflow: Webshaped 2012
RESS: An Evolution of Responsive Web Design
Building the Media Block in ReactJS
Data science for infrastructure dev week 2022
MIMA 2014 - Changing your Responsive Design Workflow
Atomic design
ACSS: Rethinking CSS Best Practices
Style Guides Are The New Photoshop (Smashing Conference 2012)
Responsive webdesign
Adventures in Atomic Design
Voorhoede - Front-end architecture
Creating Style Guides with Modularity in Mind
Atomic design React Nova Presentation
An introduction to Emulsify
Responsive Web Design: Clever Tips and Techniques
The Death of Lorem Ipsum and Pixel-Perfect Content (MinneWebCon version)
Web Standards And Protocols
Ad

Similar to The Server Side of Responsive Web Design (20)

PDF
Web Development for UX Designers
PDF
Measuring Web Performance
PPTX
Responsivedesign 7-3-2012
PPT
Testable client side_mvc_apps_in_javascript
PDF
Web app and more
PDF
Web Apps and more
PDF
Measuring Web Performance (HighEdWeb FL Edition)
PDF
Everything You Know is Not Quite Right Anymore: Rethinking Best Practices to ...
PDF
Everything You Know is Not Quite Right Anymore: Rethinking Best Web Practices...
PPTX
Front End Development | Introduction
PDF
Monkeytalk Fall 2012 - Responsive Web Design
PDF
Java EE 7 from an HTML5 Perspective, JavaLand 2015
PDF
Always on! ... or not?
PDF
Creating an Effective Mobile API
PDF
Always on! Or not?
PDF
Web Development Workshop (Front End)
PDF
Pinkoi Mobile Web
PDF
Web Performance & You
PPTX
High Performance Mobile (SF/SV Web Perf)
PDF
Measuring Web Performance - HighEdWeb Edition
Web Development for UX Designers
Measuring Web Performance
Responsivedesign 7-3-2012
Testable client side_mvc_apps_in_javascript
Web app and more
Web Apps and more
Measuring Web Performance (HighEdWeb FL Edition)
Everything You Know is Not Quite Right Anymore: Rethinking Best Practices to ...
Everything You Know is Not Quite Right Anymore: Rethinking Best Web Practices...
Front End Development | Introduction
Monkeytalk Fall 2012 - Responsive Web Design
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Always on! ... or not?
Creating an Effective Mobile API
Always on! Or not?
Web Development Workshop (Front End)
Pinkoi Mobile Web
Web Performance & You
High Performance Mobile (SF/SV Web Perf)
Measuring Web Performance - HighEdWeb Edition
Ad

More from Dave Olsen (20)

PDF
Taking Your HTML Email Communications from "Ew" to "Wow"
PDF
The Google Marketing Workflow Workshop
PDF
Building an Academic Program Database and API with Contentful and Amazon Web ...
PDF
Reimagining Your Website: What are prospective students looking for and how a...
PDF
Progressive Mobile Strategy Redux: The Future Friendly Enterprise
PDF
Case Study: Rebuilding an Admissions Web Presence
PDF
Admissions Brain Dump
PDF
Implementing Brand Patterns
PDF
Case Study: Automating Outage Monitoring & Communication
PDF
Optimizing web performance (Fronteers edition)
PDF
The Why and What of Pattern Lab
PDF
The Squishy Future of Content - HEEMAC Edition
PDF
The What & Why of Pattern Lab
PDF
The Squishy Future of Content - Key Communicators Edition
PDF
The Squishy Future of Content - Penn State Edition
PDF
The Squishy Future of Content
PDF
Web Performance & You - HighEdWeb Arkansas Version
PDF
The Future Friendly Campus (Workshop Edition)
KEY
Developing a Progressive Mobile Strategy (J. Boye edition)
KEY
The Future Friendly Campus
Taking Your HTML Email Communications from "Ew" to "Wow"
The Google Marketing Workflow Workshop
Building an Academic Program Database and API with Contentful and Amazon Web ...
Reimagining Your Website: What are prospective students looking for and how a...
Progressive Mobile Strategy Redux: The Future Friendly Enterprise
Case Study: Rebuilding an Admissions Web Presence
Admissions Brain Dump
Implementing Brand Patterns
Case Study: Automating Outage Monitoring & Communication
Optimizing web performance (Fronteers edition)
The Why and What of Pattern Lab
The Squishy Future of Content - HEEMAC Edition
The What & Why of Pattern Lab
The Squishy Future of Content - Key Communicators Edition
The Squishy Future of Content - Penn State Edition
The Squishy Future of Content
Web Performance & You - HighEdWeb Arkansas Version
The Future Friendly Campus (Workshop Edition)
Developing a Progressive Mobile Strategy (J. Boye edition)
The Future Friendly Campus

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
“AI and Expert System Decision Support & Business Intelligence Systems”
CIFDAQ's Market Insight: SEC Turns Pro Crypto
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

The Server Side of Responsive Web Design