Closed DFurnes closed 6 years ago
Aha, this also addresses #4 !
One of the only advantages I could think of with shorten
is that it doesn't require a Redis lookup to shorten a URL, since it doesn't care if it's seen this URL before. I'm curious to see how this affects response time under load.
We were having trouble connecting the dev Lambda function to it's corresponding ElastiCache instance (it was hitting Lambda's 6 second timeout and telling us nothing of value).
Adding a 1s timeout in eaed04b confirmed that it was a Redis timeout issue, and @sheyd and I "fixed" it by switching to use a Compose instance for now! We can revisit moving both dev & prod onto ElastiCache sometime later this week if we want.
Did some quick load testing on this branch with Siege and performance looks the same!
Merging this to unblock Phoenix Next work! Will revert if anything breaks on production, and happy to address any feedback in a follow-up pull request tomorrow.
This pull request replaces
shorten
withshort_url
. In addition to closing #4, it ensures Bertly always returns the same short-link if shortening the same long URL. This allows us to easily show the user their personalized link & statistics on Phoenix's "Share Drive Action" across multiple devices or page-loads, without keeping a separate table that maps signups to short-links in Phoenix.(Note that there may be edge-cases I'm not thinking of & this will invalidate any existing short-links!)