Repository navigation
API response cache #125
Replies: 3 comments
|
We're very interested in this feature too! Best would be to have something like this as core-feature, thanks for the proposal. |
|
Hi @maikschneider, thanks for starting this thread and for sharing your proof of concept — it was a helpful reference while designing this feature, and it confirmed the core idea we also arrived at: collect cache tags while the serializer walks the object graph, so invalidation is driven by the records a response actually contains. That mechanism is exactly what made it into the implementation. The good news first: a native response cache is coming in t3api 5.0.0 — tracked in #146, with the implementation now up in #147. Feedback there is very welcome, especially from people who already explored this space. @Moongazer — "best would be to have something like this as core-feature" is precisely what happened. Why configuration lives in the
How the concept grew while generalizing it for core:
Thanks again for the groundwork and the inspiration — it would be great to have your eyes on #147. |
|
Holy moly, you have thought about many great details and edge-cases, it sounds amazing! Can't wait until I find some time to test the feature-branch. I'll give feedback ASAP, thank you very much for now! 🙂 |
Uh oh!
There was an error while loading. Please reload this page.
Hey everyone,
I've been considering ways to enhance the performance of the t3api responses. Overall, I'm quite satisfied with the current performance. However, more complex endpoints with multiple relations and filtering can sometimes be slow.
To address this, I created a proof-of-concept extension called t3api_cache. The goal of this extension is to introduce a caching layer for requests. During serialization, the extension adds the corresponding cache tags to the response. These tags are then captured by a middleware that collects them, sets the cache, and cleans up the response.
I would appreciate it if you could take a look at the extension and share your feedback!
Thank you!
All reactions