Replies: 2 comments 1 reply
-
I've tried get the info from const queryCache = new QueryCache();
queryCache.subscribe(event => {
if (event.query.isStale()) {
} else {
}
}) but the callback function will be called multiple time for every query. |
Beta Was this translation helpful? Give feedback.
-
Every re-render will read data from the cache, and thus be a “cache hit”. That’s because data lives exclusively in the cache. I’m not really sure how you would quantify a “cache hit”? Maybe something like: “If a new component mounts and that component needs some data, but its already in the cache and not stale” ? But you have to be more specific. “Cache rate metrics” sounds like it’s a something you have to present to meet some managerial requirements but on its own, it doesn’t make much sense in this context... Note: if what I said is what you want, filter your events down to the type |
Beta Was this translation helpful? Give feedback.
-
Here is my use case. I'm trying to collect some metrics , and measure the performance improvement from RQ.
Beside, I'm using the persister with RQ. and It would be helpful If I can collect the cache rate metrics and adjust the cache strategy.
Beta Was this translation helpful? Give feedback.
All reactions