I recently implemented a new feature called Cache Profiles into Barebones CMS. I'm a bit stuck on the documentation because I've had to stop and figure out how I'm going to create a mobile-friendly version of the website. I eat my own dog food after all. Om nom nom.
The concept of a "mobile-friendly website" is foreign to some people. A lot of people think, "Our main website displays the exact same on the desktop, iOS, Android, etc. and therefore it is mobile!" That is NOT a mobile-friendly website. If a user has to use pinch-to-zoom or scroll horizontally at all to read the content, you have a desktop-only website. While desktop websites do display on most modern mobile devices, they are NOT mobile-friendly and users will hate you.
Actually, that is a pretty good definition of a mobile-friendly website:
"A mobile-friendly website is one that displays on small screens such as smartphones, scrolls only in the vertical direction, and is clearly readable without requiring pinch-to-zoom or similar features."
Anyway, back to the problem at hand. I have made mobile-friendly websites before, so this is old-hat for me. My problem is coming up with a strategy that is universal and makes web developer's lives simpler. With the new "tablet" devices running "mobile" OSes, it is no longer a matter of making just two designs for a single website. We've suddenly got a lot of web developers stressing out about designing for desktop, phone, AND tablet. Which is causing some developers to ask some important questions, "What's next? How many different designs will I have to make to satisfy all these newfangled devices?"
Which brings me back to Barebones CMS. The work I've done thus far on mobile web development involves, for all intents and purposes, user-agent detection. However, if I stuff user-agent detection into the caching subsystem of Barebones CMS, the performance of the cache will eventually suffer. User-agent detection has always been and will always be a very bad idea. There is a project called WURFL, which detects any mobile handset and returns the feature set it has, which is pretty much as extreme as you can get. The download is, unfortunately, several megabytes and it isn't exactly Speedy Gonzales. In the last month alone, the download size of WURFL increased by 900KB. And that is compressed data. This situation is only going to get worse. There has to be a better way.
The basic idea is to attempt to determine which layout to display regardless of device. Let's say I'm on a desktop but on a super-slow dialup connection (yes, those still exist). Well, instead of being a jerk and serving up the painfully slow desktop version, how about serving up the lighter-weight mobile edition instead? With user-agent detection alone, you can't do it, but with my basic idea, you theoretically could. This is why using user-agent detection just won't work.
Alright. I'm done with my thoughts.