Making server-side choices based on client-side information is a bit of a modern day holy grail. Client-Hints will hopefully someday make that easier, but we don’t have that yet. I’m a fan of the cookie-based approach. This polyfill by Jonathan Neal aims to replicate Client-Hints with the cookie-based approach.
DigitalOcean joining forces with CSS-Tricks! Special welcome offer: get $100 of free credit.