-
Notifications
You must be signed in to change notification settings - Fork 87
Description
Many web sites take advantage server-side identification of device type based on the User-Agent header in order to tailor responses to the requesting device. This technique is often used to tailor sites for classes of devices such as mobile, tablet and desktop. Responsive design allows for some client-side optimisations but server-side identification remains the only way to modify markup before it's sent to the client, where most gains can be made.
A recent test suggests that over 80% of the top 50 websites employ this technique, a number that's in line with previous analyses.
The proposal suggests:
Chrome could perhaps send the following for mobile, regardless of the underlying device type:
Mozilla/5.0 (Linux; Android 9; Unspecified Device) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome
…
We can ratchet this deprecation over time, beginning by freezing the version numbers in the header, then removing platform and model information as developers migrate to the alternative mechanisms proposed below.
If widely adopted, this change would remove the ability for sites to adapt to device classes on the first HTTP response, since the requisite information would only follow in subsequent requests. The first HTTP response is typically the most important, especially in the case of a new visitor. Thus this change adds a performance impact for the most critical requests. What if my service is not working for some subset of devices e.g. it's broken a way such that there is no secondary request? How do I find which devices should I look into to fix it? RFC1945 and its successors foresaw this possibility and catered for it.
The User-Agent request-header field contains information about the
user agent originating the request. This is for statistical
the tracing of protocol violations, and automated recognition of user
agents for the sake of tailoring responses to avoid particular user
agent limitations.
Furthermore, some websites also employ logic based on the User-Agent that is not at the application layer e.g. proxy servers and firewalls, in which case the second request may be too late.