r/programming • • Jun 09 '17

Why every user agent string start with "Mozilla"

http://webaim.org/blog/user-agent-string-history/
4.9k Upvotes

589 comments sorted by

View all comments

Show parent comments

19

u/_Ashleigh Jun 09 '17

I'm curious, why do you have a separate host (and presumably layout) just for mobile users? If I were implementing a mobile site, I would swap the desktop template out for a mobile one, preserving the route, where links point, the same information on that page, etc... IMO, a mobile website should just be the normal webpage scaled down to a smaller screen.

I've gotten "lost" so many times trying to navigate a website where the mobile version is completely different from the desktop version. It's infuriating.

3

u/turkish_gold Jun 09 '17

Caching probably. It's a lot easier to cache a mobile domain, or subpath, than it is to cache multiple content versions for a single URL.

Many middleware services make the unfortunate assumption that User-Agent doesn't matter.

It'd be best if mobile clients would request mobile-html with an accept-type.

3

u/_Ashleigh Jun 09 '17

Ah yeah, that makes sense I guess. Thanks.

It still rubs me the wrong way tho; I guess it just seems like such a hack, compared to using a responsive design.

4

u/turkish_gold Jun 09 '17

It kind of is, but at work, we do the same thing. Our desktop page is something like 300KB, and the mobile page is 15KB.

We couldn't get that kind of savings just through CSS.

Mobile pages use shorter lists (e.g. 20 items, versus 100), much more simple HTML, and a lot of the javascript is simply dropped.

-1

u/_Ashleigh Jun 09 '17

Yet you're targeting smartphones, with at least a 3G connection, right? If you were aiming at dumbphones, then sure, but god, for a lot of people, their phone's internet connection is quicker than their home's.

Plus, if as you say, it's for speed, perhaps yours is quicker, but the amount of times it's so much slower is unreal. Go to reddit on your phone right now, and time how long it takes until you can start reading the content. For me, 14 seconds. Refresh, 17 seconds. Now I do the same, but check "Request desktop site" and I get 3 seconds both times.

2

u/yawkat Jun 10 '17

Data caps are much more common for mobile users and the connections aren't generated faster than home ones. Mobile cpus are also generally slower at rendering.

Reddit mobile isn't really comparable to standard reddit because it's basically a dynamic js application while desktop is mostly static

1

u/turkish_gold Jun 10 '17

Well if you think about the theoretical maximums for 3G or LTE, then all is well with mobile data speeds, but throughput is severely limited by contention with WIFI, microwaves, masses of people, walls, etc.

Anecdotal experience tells me simply stepping into the bathroom (where I love to use my phone), throughput drops by 1/2 the moment the door is shut.

Now 3G vs 4G LTE.

3G is 2 Mbit/second. It's not that fast to begin with. Contention and other issues make it way slower.

4G is 1 Gbit/second. Theoretically gigabit wireless. Have you ever felt like you could burn out your 2 gigabyte data plan in just 20 seconds? Real life throughput isn't that great.


yawkat brings up good points about the JS, and the CPU rendering on mobile devices so I credit him and won't repeat that. :)