Stylianos Gakis
05/17/2022, 12:47 PMbod
05/17/2022, 1:03 PMIf I haven’t configured a httpCache in my ApolloClient, does that mean that any calls to httpFetchPolicy on any of my `ApolloCall`s have no effect?Correct ✅
How does it work if you’ve got both of them configured at the same time?Well, the HTTP one is last in the call chain. In theory a cache miss at the normalized level could still result in a cache hit at the HTTP level, but I don't expect this scenario to happen often. This page explains the differences between the 2. In summary, the HTTP one is simpler to setup/use but less powerful than the Normalized one.
Stylianos Gakis
05/17/2022, 1:27 PMCorrect ✅Damn it must’ve been like that for years 😂 Thanks a lot for helping out! But alright I think it makes sense actually. We got the normalized cache configured already, so adding the Http one is probably like a “why not” situation right? Then I wonder, are there any use cases where you’d want to configure a different fetch policy for one and a different for the other? If not, maybe I could introduce a function locally that just configures the same policy for both caches
Grégory Lureau
05/17/2022, 1:34 PMso adding the Http one is probably like a “why not”Is it not risky to have normalized + http cache? I've lost enough time with cache issues to consider them very carefully and only pick the more relevant one when possible. Is there advantages to use both of them?
bod
05/17/2022, 1:47 PMStylianos Gakis
05/17/2022, 2:03 PMapolloClient.httpCache.clearAll()
apolloClient.apolloStore.clearAll()
I don’t think either of these functions are referenced inside the documentation. Did a text search in the folder “apollo-kotlin/docs/source”. Should they be mentioned somewhere?bod
05/17/2022, 2:06 PMthey’d have to do both right?✅ correct
Should they be mentioned somewhere?Aren't, but probably should yes 😅
Grégory Lureau
05/18/2022, 6:59 AMbod
05/18/2022, 7:47 AMGrégory Lureau
05/18/2022, 7:55 AMbod
05/18/2022, 8:02 AM