top | item 45453445

(no title)

mimsee | 5 months ago

If I wanted to achieve the same result, that is to serve assets of others from my own domain, I'd just create a custom endpoint like /api/user-avatar/:userId and an action proxies the actual image from google, maybe keep a cached copy for some time to not have to redownload the image on every request.

discuss

order

arcfour|5 months ago

Especially since, if you were doing this on CloudFlare—which you can with OpenNext—it's incredibly simple to work with CloudFlare's caches in Workers. For example: https://developers.cloudflare.com/workers/examples/cache-usi...

Plus there's their Images service which could come in handy to transform them a bit, too, if you wanted.

skylurk|5 months ago

This. Only needs a couple lines of nginx config.