DEV Community

Discussion on: How-to: Creating a super simple URL shortening service

Collapse
 
yellow1912 profile image
yellow1912

If you are already using a web server such as nginx, you can certainly put the redirection code directly there which can handle millions of requests. The idea is that you can manage your redirection rules however you want, you can even store them in db, then you populate them to redis for example, and within nginx you can use Lua to write simple code to retrieve the redirect rule and do the redirection on there. It's a bit more complicated but worth it if you handle many many redirections.