Based on the documentation for http cache, `HttpFe...
# apollo-kotlin
a
Based on the documentation for http cache,
HttpFetchPolicy
. It is not clear to me whether the http cache has an option for both cache and network both times (cache first, then hit network) . does the
CacheFirst
option enable hitting both everytime? the normalized cache supports
CacheAndNetwork
or would it require me to use the normalized cache instead?
m
The normalized cache
CacheAndNetwork
was added after the fact and it hasn't been implemented for the HTTP cache indeed
Can you open an issue?
a
sure thing!
🙏 1
i think this is descriptive enough, but obvs if you need clarification I can update it
m
That's perfect, thanks!
Only caveat is whatever solution we come up with won't be
.watch()
as
.watch()
is really only possible with the normalized cache
Until there is a
HttpFetchPolicy.CacheAndNetwork
, I think you can relatively easily make an extension function that "bundles" 2 calls and returns a
Flow
a
🥳 alright. ill try it out, worst case scenario is that it hits the network twice, correct?
m
If you do the first one
CacheOnly
, there's no reason it hits the network twice
a
oh right!!