4 ms·
So, the one main use case that can't be handled by feature detection or a JavaScript API is returning a mobile or desktop site without extra round-trips. If a
by lambda 12y ago
So, the one main use case that can't be handled by feature detection or a JavaScript API is returning a mobile or desktop site without extra round-trips.
If a server can detect that you have a mobile user-agent, it can directly deliver you an optimized mobile site, that avoids sending lots of extra data that is only relevant for the desktop version, and avoids extra slow round-trips to fetch data later once JavaScript based detection has had a chance to run.
UA strings are awful, but I haven't seen any other good solution for this problem.
- TazeTSchnitzel 12y agoWhy are desktop and mobile sites so different? Why do they need to be different? Can't we just make responsive designs? Having separate desktop and mobile sites is an anti-pattern.
- qq66 12y agoA phone-optimized site will have less content, usually, so why send the extra data to phone that don't need it, especially when those phones are running at lower bandwidth and are often billed per gigabyte?
- TazeTSchnitzel 12y agoI usually find it frustrating when a phone site doesn't let me see what the desktop site does. If there's content only for one form-factor, load it with AJAX.
- dubcanada 12y agoI disagree, there are instances where having a completely different website for a smaller form factor is beneficial to the user.
- mcovey 12y agoIt is! And I wish more sites would make it accessible like it used to be by just going to m.domain.tld rather than user-agent sniffing, because I often prefer the simpler mobile version I get when I spoof my user agent from the desktop.
- tracker1 12y agoWhich is great.. until I do a google search for my closest movie theater on my phone to pull up the listings... the link to that theater's page is right at the top... "great" ... now I click the link and the site redirects me to m.theater.com/ (no path after the slash) ... now I'm stuck slogging through several pages to get to what I wanted. This happens a lot.. there's a page on the desktop site that doesn't correspond. Responsive design still shoves a lot of extra resources at a client that the smaller devices especially don't need. Responsive rendering then loading an adaptive client in the browser is a better option... browser sniffing is the only way to do this.
- marcosdumay 12y agoIt would be great if we had a header that tells the screen size. And it would actually help solve the problem, instead of just placing another layer of band-aids above it.
- ArtDev 12y agoIf you are trying to serve a separate mobile website, you are doing it wrong (as of ~2 years ago). Responsive design is the modern standard. (I am a frontend developer)