Hacker News new | ask | show | jobs
by aaronbwebber 2232 days ago
Tip: if your site is going to redirect from the bare domain to something else (e.g. `https://example.com` -> `https://example.com/home/`) make sure you enter the final destination, letting it redirect means that the cost of the redirects will be included in the report, which is unlikely to be what you want.
3 comments

Unless that redirect is something your users are likely to experience, in which case you shouldn't cheat and provide a URL that delivers a different loading delay than visitors will encounter.
Well...in many cases all it really tells you is the roundtrip network latency, which may or may not be something you are interested in.

In my case it actually was sort of interesting - it definitely suggested that the redirects don't have the correct caching headers, because they clearly weren't being served off the CDN. However, this redirect is a pretty unusual case for us, because most of our traffic is either from SEO or links from notifications we send users.

I agree that you should be looking at the experience most users are going to have, but if the first experience for most users is a redirect you should probably do something about that.

Yep. We try to indicate when you're being affected by redirects since `http` -> `https` and `example.com` -> `www.example.com` are common ones. Those can often mean hitting an origin server instead of an edge server first.
Yup! As I noted in a comment above, this is just not a common case for us - usually our inbound traffic is coming from SEO which sends you to the right place. But when I am typing it into a search box, it's real easy to forget.

I am going to look into getting those redirects cached though, there's no reason we shouldn't be able to serve them off the edge.

Usually you want to include that time, especially if most of your users will be going to the first url with the redirect.
Users will typically hit redirects like that when typing in a URL manually, but not in the much more common case of being linked to the site.