question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introduce caching options

See original GitHub issue

In some cases, nested GraphQL queries can result in a (large) number of duplicate requests to the wrapped REST-like API. In consequence, many slow HTTP(S) requests need to be performed, backend systems may be burdened, and rate limits may suffer.

One option to avoid this behavior is to introduce caching in the GraphQL layer. Caching would:

  • Be optional and disabled by default
  • Be applicable to query operations only, which we assume to be safe and idempotent

In a first implementation, caching could be enabled globally for all query operations. A maximum cache duration in milliseconds can be provided (with a sensible default). In later implementations, caching could be enabled for selected endpoints only, for example based on the operationId property.

For a simple example of how to enable caching based on the URL of a request, consider: https://github.ibm.com/witternj/secure-graph/commit/23ea7287f2651d220092fced20f88d0bad9d6be7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
wtrockicommented, Sep 6, 2019

@Alan-Cha Leave me with this

0reactions
wtrockicommented, Oct 18, 2021

Sadly not

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Caching and How it Works - AWS
Cached information can include the results of database queries, computationally intensive calculations, API requests/responses and web artifacts such as HTML, ...
Read more >
All things caching- use cases, benefits, strategies, choosing a ...
Improved responsiveness: Caching enables content to be retrieved faster because an entire network round trip is not necessary. Caches maintained close to the ......
Read more >
An Introduction to GridPane Server Caching Options
GridPane offers two types of caching: Page caching (2 options available) and object caching. Our page caching options will cache your individual ...
Read more >
11 Introduction to Caches
11 Introduction to Caches · Distributed Cache · Replicated Cache · Optimistic Cache · Near Cache · Local Cache · Remote Cache ·...
Read more >
A Comprehensive Guide to Website Caching - DreamHost
Types of Caches ... There are many different types of caches, but these are two of the most common choices: ... Less common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found