Query retries and backup recommendations (JavaScript)

Sometimes, LiftIgniter's JavaScript SDK does not receive a legible response from LiftIgniter's model servers. This is usually due to network connectivity issues, but it also covers the case of server errors and some client errors.

We presently use two mechanisms to address this issue:

  • Query retries
  • Backup recommendations

Query retries

If an initial response is not received within 4.3 seconds of the query being made, then the client retries the query. The retry occurs on query1.petametrics.com rather than query.petametrics.com, to address any temporary DNS resolution or SSL certificate validation issues.

The retried query should respect all the rules requested in the recommendations.

The associated configuration variables, that you can modify using $p("init"), are as follows:

  • Config.sdk.backupQueryServer is a string specifying the backup query server. The default is "//query1.petametrics.com".
  • Config.sdk.retry is a Boolean specifying whether retries are enabled. The default is true.

We recommend contacting Support to discuss any modifications you want to make to this configuration, so that we can suggest the best way to accomplish your goals.

Backup recommendations (rules not respected)

If no response is received within 10 seconds from either query.petametrics.com or query1.petametrics.com, we render backup recommendations. The backup recommendations are fetched from our CDN after 2.5 seconds of the original query if no response is received from query.petametrics.com.

The backup recommendations are static and may not respect all the rules that you have requested within the recommendations. If you have a complex rule structure and would rather handle backup recommendations on your side, then we can disable backup recommendations.

The associated configuration variables, that you can modify using $p("init"), are as follows:

  • Config.sdk.enableBackup is a Boolean specifying whether backups are enabled. The default is true.

Backup recommendations are constructed by running a query with no context (other than the organization key) and storing the result to the CDN. The results are refreshed every two hours. If the query fails to complete during a particular refresh, the previous value persists.

We recommend contacting Support to discuss any modifications you want to make to this configuration, so that we can suggest the best way to accomplish your goals.