7 ms·
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 an
by mimsee 1y 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.
- arcfour 1y agoEspecially 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-using-fetch/ 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 1y agoThis. Only needs a couple lines of nginx config.