4 ms·
I remember reading a HN thread a few years ago where this was suggested as the cheapest way to create short links. Instead of running a server with routes on it
by kirillzubovsky 8y ago
I remember reading a HN thread a few years ago where this was suggested as the cheapest way to create short links. Instead of running a server with routes on it, you just need to generate 1 static page with this meta tag per each link, then it's always there. Could it be that Twitter folks were simply trying to be efficient?
- adanto6840 8y agoUm, they have to run a lookup to find the 'value' for the given 'key' regardless...? I cannot think of any positive value for the user here -- it's non-standard & slower. 3XX redirects have been around a long time and basically every single client out there knows how to use them, and those that don't can look the status codes up to see how they should handle them if they want to. AFAICT this is purely to allow for the 'pseudo injection' of the third-party JS, presumably for tracking purposes... Only question I'd have is why they can't read the cookie server-side instead, but I'm guessing there are cookies on other domains that their JS is looking for? Haven't done web stuff in a few years so I'm behind on CORS-ish pros/cons/knowledge.
- icebraining 8y agoI'm guessing there are cookies on other domains that their JS is looking for? Nah, the browser doesn't let you do that. This SO answer suggests it's to pass the Referrer header so that the destination site knows the user came from Twitter: https://softwareengineering.stackexchange.com/a/343667 https://softwareengineering.stackexchange.com/a/343667
- Leace 8y ago> Could it be that Twitter folks were simply trying to be efficient? That wouldn't explain the User-Agent sniffing (curl gets a proper HTTP redirect).