Comments (5)
Hi Aaron, thanks for the feedback.
I want to clarify that we're not saying these features will never be offered in Apollo iOS. It's clear there is more work to be done on the cache and we acknowledge that; it's why you'll see cache improvements listed as an item on our roadmap. We have a vision for a configurable cache with TTL, better eviction mechanisms, and hybrid configuration. However, users should still be deciding how to handle memory warnings for the application, we donβt want to make that decision for you.
It is unfortunately not at the top of our list of priorities right now so until we get there I've updated the cache documentation with a note regarding that responsibility.
from apollo-ios.
Hi @postmechanical - I don't believe this is a bug and it comes down to a difference in philosophy of responsibility.
In my opinion InMemoryNormalizedCache
should not respond to UIApplicationDidReceiveMemoryWarningNotification
and it certainly should not automatically clear the cache unless you configure it to. Furthermore you cannot configure it to do that because we do not offer that functionality. What we do provide is the ability for you to manage your cache data. If the documentation led you to believe we manage cache memory for you please let me know where it states that and I'll correct it.
from apollo-ios.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
from apollo-ios.
@calvincestari That is not a philosophy that scales to thousands of developers seeking to deploy this code in performant and reliable apps to millions of end user devices. Happy to call it a documentation bug that could be mitigated by a warning here that users must implement their own memory pressure handling otherwise the default configuration will result in unbounded memory consumption.
I urge you, however, to consider a more end user, product, and customer focused philosophy. The Kotlin SDK maintainer's philosophy has resulted in an API that both anticipates the issue described here and provides a configuration based interface to manage it. It's not too dissimilar to NSCache
's API, which is the standard tool for in-memory caching on Apple platforms.
Defaulting to something like a NullNormalizedCache
or making the cache
param optional here would also be an option if updating the documentation to warn against ubounded memory consumption in InMemoryNormalizedCache
is not an option.
from apollo-ios.
Much appreciated
from apollo-ios.
Related Issues (20)
- iOS 13.0 or newer error - compile fails HOT 3
- Custom Scalar | ApolloAPI.JSONDecodingError.couldNotConvert(value: AnyHashable to: Swift.String HOT 5
- How should I continue after handleErrorAsync inside a custom ApolloErrorInterceptor? HOT 5
- Defining a CustomScalarType which is [String:Any] HOT 8
- Deprecate `legacyResponse` and prepare for partial/incremental caching HOT 2
- Custom scalar isn't being respected HOT 7
- @defer issue HOT 8
- Documentation for @import directive. HOT 9
- Add debugDescription api for Apollo generated types
- Circular reference Build Error HOT 6
- Invalid redeclaration of synthesized property '_id' HOT 7
- Split/Hybrid Caching between InMemory and SQL review and thoughts HOT 2
- ID as a custom scalar HOT 6
- Bug: Cache writes of incremental responses uses incorrect parent key (custom cache keys)
- Incorrect PR link in release notes for version 1.11.0 HOT 2
- apollo-ios-cli deprecated --schema-name HOT 2
- Confused about cache behavior HOT 2
- CLI fails to run with 1.12.0 HOT 4
- Response value getting nil HOT 2
- Version mismatch between package and CLI HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-ios.