skip to main content

QG cache

The Query Generator is the Livebase component translating the GraphQL queries received by a Cloudlet into SQL queries.

In the Cloudlets section of the Dashboard, click on the icon in the lower right corner of the Cloudlet panel and choose the Configure option.

Configure Cloudlet

From the Cloudlet configuration panel, click on the QG Cache tab.

The Query Generator can keep in a memory cache the translation of the received queries in order to avoid translating the same query multiple times, thus improving the response time of the GraphQL request.

The checkbox Cache enabled toggle the Cloudlet support for query cache: if no changes have been made, it is enabled by default.

If the query cache is enabled the followings settings can be set:

  • Max cache size: maximum number of entries, i.e query translation, that can be stored in the cache (default value 3000);
  • Entry expiration time: represents the time, expressed in minutes, an entry can stay unused in the cache (default value 30 minutes);
  • Translation threshold: cache will contain only entries whose translation take longer than the specified threshold time, expressed in milliseconds (default value 400).

Configure Cloudlet

In addition to the parameter that allows the global deactivation of the cache for the entire Cloudlet as previously seen, it is possible to disable the cache for a single GraphQL query. To do this, it is necessary to add the disableCache parameter to the service call,

query {
  Class1___getPage(disableCache:true){
    items{
      _id
    }
  }
}
query {
  Class1___get(id:"12345", disableCache:true){
    _id
  }
}