Mini-CDN Library as alternative to Image Transforms #15702
activenode
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I built this sharp-based, MIT-licensed library which allows to use Vercel e.g. as your "CDN" for images because I found
getPublicUrl
etc. cumbersome and simply wanted a policy-respecting image link.The idea is simple: Respecting the file size limit and scaling down images whilst keeping enough resolution for most use-cases and using the cache header to avoid unnecessary hits.
If you need the ORIGINAL resolution you can still directly use the rather inconvenient
getSignedUrl
with a Download button or so (such as seen in many Web Apps)In theory it would also allow you to have it actually separated from your own project (since Supabase is hosted anyway and not part of the repo).
Check it out: https://github.com/activenode/supabase-nextjs-image-api
I might add a "HowTo" Video on my YT Channel soon, so if you wanna see it in action you can sub (youtube.com/@activenode/)
Beta Was this translation helpful? Give feedback.
All reactions