-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpCache configuration #5878
Comments
Hi 👋 Can you share how you're setting up the HTTP cache?
|
Here is what it looks like
|
Thanks for sending this! My DI skills are a bit lacking (what is |
3.8.2, would essentially an instance of cache for each client configured separately, which could then produce the issue as mentioned in the description For now though, I am choosing to use different sub directory for each client, which should also prevent such issues |
I think val sharedCache = DiskLruHttpCache(FileSystem.SYSTEM, File("someDirectory"), HTTP_CACHE_SIZE)
ApolloClient.Builder()
.serverUrl("https://...")
.httpCache(sharedCache)
...
.build()
// Same with other clients But using different directories work too 👍 |
Question
Can an HTTP cache be shared for multiple ApolloClient instances?
Although the cache policy that we have for now is
NetworkOnly
, it seems like the queries do get written to the cache respectively here.Right now we have two clients using the same cache with same cache policy of
NetworkOnly
but we do see issues with cache where the tmp cache file is sometimes not found, and my assumption here is, that it probably is because of the same cache being used, where a query execution through one client might delete the same file as being used by the other client.The text was updated successfully, but these errors were encountered: