Please sign in to comment.
Updated and classed-up the readme.
- Loading branch information...
|@@ -1,7 +1,18 @@|
|-Spent today messin’ around with responsive images, and thought I might try a back-end approach—it actually started to look kind of promising, so I may as well throw my scratch paper up here, yeah?|
|+Calland — Responsive Images|
|-So, the basic idea is that the .htaccess file intercepts the request for the image file and forwards the path along to img.php, which potentially generates and caches a smaller version of the image depending on the screen size set in the ‘rwd-viewport’ cookie via JS.|
|+Just wanted to experiment with a seamless approach to responsive images. Which is to say “the src points to the image as usual, and all the magic happens behind the scenes.”|
|-Said cookie is set to the greater of the device's height or width, to allow for full-bleed images regardless of device orientation.|
|+So, the basic idea is that the .htaccess file intercepts the request for the image file and forwards the path along to img.php, which potentially generates a smaller version of the image depending on the screen size set in the ‘rwd-viewport’ cookie. As this is set in the document’s head, it’s available to scripts invoked in the document’s body on initial load.|
|-Here's the big thing: I'm not sure how I feel about delivering the mobile images to users with cookies disabled. Granted it's a better approach than potentially throwing monster images at users on a Nokia 6230, but... Still, there has to be some way of providing a fall-back method for passing the viewport information along to the backend.|
|+Said cookie is set to the greater of the device’s height or width, allowing for full-bleed images regardless of device orientation.|
|+## What I Don't Like|
|+# There's nothing going on (yet) in the way of caching the generated images.|
|+# The lack of control. One doesn’t always need potentially screen-width images, so I want to introduce some way of controlling this on a image-specific level.|
|+# Everything hinges on cookies and JS being enabled. Again, I’m just messing around with this, and haven’t come up with anything in the way of a plan-B—I wouldn’t use this for any production sites yet.|
|+## What I Do Like|
|+# The name is kind of clever, right? Eh, eh?|