RESTDataSource has double caching
See original GitHub issueIt stores all caches in cache implementation InMemory, Redis, Memcache and also in Map object. Second time if you send same request it will return the cache value from the Map. This will override ttl config. Not sure also how this is safe, in terms of memory, how big the map object will be if it stores all responses.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Odyssey Part 2 - Caching of RESTDataSource does not ...
I have the same issue, because the /tracks endpoint is cached, but /author/{id} isn't, the data source doesn't speed up the request that...
Read more >How Apollo REST Data Source Deduplicates and Caches ...
Today I learned that RESTDataSource comes with two awesome performance optimizations out of the box: Request Deduplication and Resource Caching.
Read more >Apollo - Server(GraphQL): Using Batching together with ...
I mean, here we have 2 caching layers. The DataLoader which batches requests and memorizes - with an per-request cache - which objects...
Read more >Apollo Rest DataSource - YouTube
When working with a GraphQL server many times you want to get data from an external api. Apollo can cache these requests using...
Read more >Manage data freshness - Looker Studio Help
Fetching cached data can be much faster than fetching. ... Every component in a Looker Studio report has its own individual cache. That...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@uarsovic Yeah, that’s not how data sources are meant to be used. You should export the class from your other module and instantiate it in the
dataSources
function.Sharing a data source between requests will be guaranteed to lead to trouble, because it means you don’t have access to the current request’s context through
this.context
for example. And we plan on extending data sources with more features that require them to be bound to a request, like tracing of backend calls.I think this should be somehow documented, I had the same problem.