![]() ![]() We'll cover each of these cases individually. Tokens can be generated by multiple strategies by using 3rd party libraries or using conventional methods like Base36 encoding. Otherwise, the system may incorrectly redirect the short URL to another location (long URL). The URL Shortening service must ensure that the token should not be assigned to two (or more) different long URLs. The logic to generate unique, random tokens can be tricky. URL Redirection workflow Token Generation The short domain in the short URL has to be mapped to the service like below: When a user clicks on the short URL, the request should be redirected to the URL Shortening Service, which would then redirect it to the actual long URL location. ![]() URL Generation Workflow HLD - Short URL Redirection If the existing short URL has expired, then a new one has to be created and sent as a response. ![]() If the incoming long URL already exists in the system, then the previous generated short URL has to be returned. The URL Shortening service accepts a long URL as input, generates a short URL, and returns it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |