RESS [ˈrəs] - RWD And Server-Side Components
How often you write a waste condition or another piece of code in your responsive frontend project, based on different viewports or different browser capabilities. That would be totally obsolet, if the server has some more information about the device to which it delivers. At this time, RESS comes into the game.
This document is the result of my research for already existing RESS implementation written in Node.js.
I'm not a fan of DDRs (Device Description Repositorys) like WURFL, but today it seems to be the only consistent solution of server-side feature / device detection.
Another promising way to grab some information from the client-side are HTPP Client-Hints, coined by Ilya Grigorik.
HTTP Client Hints can be used as input to proactive content negotiation; just as the Accept header allowed clients to indicate what formats they prefer, Client Hints allow clients to indicate a list of device and agent specific preferences.
I would appreciate to see CHs landing in all modern browsers. Good stuff already happening: Blink: Intent to Implement: Client-Hints header (DPR switching)
So, I assume that server-side feature detection is not possible at the moment, without hacking cookie or redirect based techniques (Detector).
I do NOT want to use:
- .. a DDR / device database
- .. a cookie/session based technique
- .. a client-side javascript solution, in which the client is polling for specific content. (e.g picturefill.js)
Server-side detection of, what?
@todo
- Features (with caniuse!?)
- Device Category ?? We should really need this? Why?
- Viewport properties (e.g size, orientation)
- Context information (e.g current bandwidth, inMotion, ..)
@todo
- User-Agent detection (
req.headers['user-agent']
) - UA parsing
- Extract device and browser identifiers
{name:'android', version: '2.3', device: 'GT-I9100'}
- [and assigment to a device-class (e.g mobile, mobile-, desktop) ] Device Classification
- Get latest data from Can I use support tables caniuse-db
- [ Talk ] - RESS: An Evolution of Responsive Web Design, great talk about RESS by @dmolsen
- [ Frwk ] - Detector, yet another server-side browser & feature detection lib written in PHP.
- [ Frwk ] - Categorizr.js: A frontend only device detection lib, written in Javascript.
- [ Blogpost ] - Categorizr.js, by @iamdustan
- [ Slides ] - RESS, by @maddesigns
- [ Frwk ] - express-device: Node.js device detection lib, build on top of express. (Available via NPM)
- [ Frwk ] - detectmobilebrowsers.com Mobile browser RegExp filter.
- [ Frwk ] - UA-Parser A Node.js UserAgent-Parser implementation. Project website
- [ Tutorial ] - RESS: Templating with Detector & Mustache
- [ Frwk ] - mobile-detect.js A mobile detection framework for client and server.
- [ Blogpost ] - Make Client Side Data Available Server Side, Server & Client communication via Cookies
- [ Frwk ] - Node.js Caniuse implementation node-caniuse