SorinS
Convex Communityβ€’7mo agoβ€’
4 replies
Sorin

[billing] query cache hit counts towards billed function calls?

Sorin here. with 4 questions πŸ˜„

Question1: do cache hits on queries get counted in function calls?
Question2: do cache responses size gets reflected in any billed metric?

Context: I am asking this because a patern we are using in react is to work with caches in useQuery from tenstack query. One example: in a chat app, the name of the user for the chat messages is resolved with useQuery(["get-User", userId]...) in all the chat bubbles.

Moving to convex, I understand that the caching is done server side. so I assume each mount of each chat bubble is a query. Most would resolve from cache, but what about the billing? (Question 3)

The response decides the path we take next in regards to ditching ten stack query in favor of cached convex useQuery.

We are aware of the ten stack adapter, but I was evaluating if we can drop ten stack all toghether. But that one actually does client side caching and the network req goes only one time. is this changed with the helpers? (question 4)

I know it's a bit more then just a simple discord question, but I feel that this kind of behaviur can affect billing at scale. I din't find enything clear on docs or on official convex channels.

Thanks in advance!
Was this page helpful?