Open GlenDC opened 8 months ago
What storage should be used for the cache? Pingora cache has an implementation for in-memory storage, but even it has a comment that it should be marked only for unit tests. Maybe Redis should be used for storage? This will allow multiple instances of the proxy to share the cache
Rama will provide an async trait for the storage. The implementations we provide will be Memory and Filesystem (fs). Any other possibilities can be implemented in community crates or by the lib user themselves.
I would like to take up this task, if this issue is still low priority. I'm still learning Rust, so this should be good practice for me.
It is still open. Not the easiest issue though, design wise then. But feel free to come up with something and we can go from there. Or I can propose a design here and together we iterate on it here. Or whatever you want. Not urgent.
The cache works on a resource level, what caches traditionally do, and allow you to work in context of the relevant HTTP RFC's to serve content from a cache (e.g. some file system available to the proxy), instead of making the request using the inner
Service
. Your typical cache basically.Low prio item, available for others to pick up.
Feel free to be inspired by https://github.com/cloudflare/pingora/tree/main/pingora-cache, but don't copy code from it as-is, given this is licensed code, and not sure how we would need to comply with it if we would take code from it. It anyway is a different kind of way to structure proxies, so no direct mapping would be possible anyway. Just to say, a lot of the things you have to be careful about you can probably find there.