4 ms·
In my company we created our own link shortener using AWS S3. ... just create an S3 bucket with a short domain, configure it for static web hosting, and upload
by elondaits 5y ago
In my company we created our own link shortener using AWS S3.
... just create an S3 bucket with a short domain, configure it for static web hosting, and upload empty files which have the "Redirect" metadata property set to the destination URL. Voila!
You won't have analytics (maybe this can be configured via AWS, but I can't say) but you don't need a server either.
I want to eventually create a friendly control panel to create and delete shortcuts using React, AWS Lambda and Cognito... but I still haven't had time... and we only need to add a handful of short links per year. This can also be scripted and done quickly through the CLI.
- tyingq 5y agoCloudflare's Workers/KV is pretty ideal for a link shortener. There's a small bit of js to write, but the KV database is just short->long and it's cached at the edge. And it's either free (< 100,000 requests/day) or $5 for 10 million requests. And the admin panel provides a simple way to edit the KV database, so you don't have to write a db editor.
- kevincox 5y agoNote that Cloudflare Workers run before the cache unless you get creative (you basically need a second Cloudflare domain configured in front of your workers). For something as simple as a URL shortener it may not be critical but it does mean that you are paying for every request which can add up for a popular link.
- tyingq 5y agoAh, I was talking about the other cache...the KV cache. Meaning that the short->long mapping is cached for performance reasons, so it's an eventually consistent, distributed, link shortener. But, yes, not free if you exceed 100k requests/day. $5 per 10 million requests beyond that. The idea of fronting it with the actually free regular cache is interesting. There is an API to control that "regular cache", so you could probably control that from the side rather than chaining the proxies/domains.
- brtkdotse 5y ago> ... just create an S3 bucket with a short domain, configure it for static web hosting, and upload empty files which have the "Redirect" metadata property set to the destination URL. Voila! Heavy “Dropbox is just cvs mounted over ssh, easy!” vibes over here.