https://authzed.com logo
#spicedb
Do caveats have impact on caching?
# spicedb
r

rierevin

09/25/2023, 9:41 PM
In a read heavy application, what percent of my check permission requests should be hitting the cache? I just found out that evaluating caveats prevent cache lookup, so as short term solution I removed passing the context to the requests. I'm still getting a lot of misses (and as a result, resource exhausted errors) even with this change, so I was wondering what the normal percentage would be if I was not writing any new data and just hitting the same checks over and over? I'm wondering if I need to completely remove the caveat from the relationship to actually fix this issue.
v

vroldanbet

09/25/2023, 10:00 PM
Subproblems with caveats are cached. I believe the part that is not cached is the result of resolving the intermediate caveat with your client-side provided context. Depending on your schema and data shape, there is a chance that the caveat resulting of traversing multiple relationships may not be reusable in a subsequent request. The cache hit percentage depends on the volume of data and request rate. Cached subproblems are evicted from memory once the quantization window elapses (by default 5 seconds).
j

Joey

09/26/2023, 12:34 AM
yeah, caveats should have no impact on caching