Is Worker KV the best approach for caching high latency requests
Hey guys, Im trying to solve my software problem without the need of a gigantornomous refactor.
Basically, I make requests to n8n through cloudflare worker proxy, but these requests take so damn long to finish and the payloads sometimes are gigantic.
So, as Im a dumb folk, I found that instead of creating a trigger to load everything on database as soon as new user is created to pre-fetch the whole data (this would take a lot of refactor on database), I've chosen to just intercept requests on proxy, and save them on worker KV, to use it as cache, and whenever there is a cache hit, loads from KV instead of making the request again, but that is exploding whenever I request something actually huge for my server to handle, so Im very lost rn and want to find a solution for this.
Basically, I make requests to n8n through cloudflare worker proxy, but these requests take so damn long to finish and the payloads sometimes are gigantic.
So, as Im a dumb folk, I found that instead of creating a trigger to load everything on database as soon as new user is created to pre-fetch the whole data (this would take a lot of refactor on database), I've chosen to just intercept requests on proxy, and save them on worker KV, to use it as cache, and whenever there is a cache hit, loads from KV instead of making the request again, but that is exploding whenever I request something actually huge for my server to handle, so Im very lost rn and want to find a solution for this.