302, because browsers do not cache it by default, so every click reaches the serviceReturn 302. A 302 Found (or 307) is a temporary redirect, and browsers do not cache it by default. So every click reaches the service and can be counted. The cost is more traffic.
A 301 Moved Permanently can be cached by browsers. Repeat clicks then go straight to the target, and the shortener never sees them. That is why "301, because browsers never cache redirects" is wrong: browsers do cache 301. And "301, because permanent redirects are faster for every request" misses the point, because the shortener would lose the clicks it must count.
Read more
- 301 Moved Permanently (MDN) (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301)developer.mozilla.org
- 302 Found (MDN) (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302)developer.mozilla.org