codi.link icon indicating copy to clipboard operation
codi.link copied to clipboard

refactor(Root): Compress url before encoding to base64 to make it shorter

Open QuevedoIB opened this issue 3 years ago • 5 comments

Moved out of main url logic, now url gets compressed and encoded to b64 to save up space

Before refactor Length is 24104

After refactor Length is 8607

ISSUES CLOSED: #7

QuevedoIB avatar Oct 04 '21 22:10 QuevedoIB

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/midudev-pro/codi-link/AF7BEtNLR73HzGQcyPh1JaY8PoBm
✅ Preview: https://codi-link-git-fork-quevedoib-refactor-compress-url-midudev-pro.vercel.app

vercel[bot] avatar Oct 04 '21 22:10 vercel[bot]

Nice job. Please, check the related issue to close. I think is #8 ;)

javigaralva avatar Oct 05 '21 07:10 javigaralva

@javigaralva Thanks! I'm not sure if this PR closes #8 since midudev specified to avoid b64 encoding in that issue and with this approach we save a lot of space but we still encode in b64.

I've just tested and with compression + encoded uri component we save like 40 characters in a link with this content Link Since optimization is not that huge @midudev do you prefer encodedUriComponent or b64?

QuevedoIB avatar Oct 05 '21 07:10 QuevedoIB

@QuevedoIB could you please fix the conflict! Sorry for the trouble!

midudev avatar Oct 23 '21 14:10 midudev

@QuevedoIB could you please fix the conflict! Sorry for the trouble!

Done! 🥇

QuevedoIB avatar Oct 23 '21 15:10 QuevedoIB