miklos
miklos
TTCTheo's Typesafe Cult
Created by miklos on 4/16/2024 in #questions
Caching getSignedUrl without DB?
In my tRPC using app, I store image files on Cloudflare R2. The client browse these images by listing them over a query method, that generates a signed url for each with getSignedUrl. However for each request the client makes, these signed URL change all the time, making the browser really overfetch these resources. My idea was storing these signed URLs in the db, but I don't like the extra latency the DB reads would introduce. Making getSignedUrl deterministic would be a much cleaner solution, unfortunately the package doesn't support this. What are my options here?
4 replies