{"_id":"58794adccd4a9c37007c96ad","project":"5668fab608f90021008e882f","category":{"_id":"5697430b69393517000c82b5","version":"5668fab608f90021008e8832","__v":3,"pages":["56975a3d59a6692d003fadae","56a2c3dff4f3410d008a84dc","56d88ca37a04df0b00ddf1c7"],"project":"5668fab608f90021008e882f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-14T06:41:15.588Z","from_sync":false,"order":10,"slug":"faq-troubleshooting","title":"FAQ / Troubleshooting"},"parentDoc":null,"user":"5668fa9755e4b32100935d41","__v":0,"version":{"_id":"5668fab608f90021008e8832","__v":19,"project":"5668fab608f90021008e882f","createdAt":"2015-12-10T04:08:22.769Z","releaseDate":"2015-12-10T04:08:22.769Z","categories":["5668fab708f90021008e8833","569740f124490c3700170a64","569742b58560a60d00e2c25d","569742bd0b09a41900b2446c","569742cd69393517000c82b3","569742f459a6692d003fad8f","569743020b09a41900b2446d","5697430b69393517000c82b5","56a17776470ae00d00c30642","56a2c48a831e2a0d0069b1ad","56b535757bccae0d00e9a1cd","56e1ff6aa49fdc0e005746b5","57e1c88115bf6522002a5e4e","57fa65275ba65a17008b988f","57fbeea34002550e004c032e","58474584889b6c2d00fb86e9","58475dcc64157f0f002f1907","587e7b5158666c2700965d4e","58a349fc30852819007ba083"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.18.0","version":"1.18"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-13T21:47:08.475Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":10,"body":"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.\n\nWe presently use two mechanisms to address this issue:\n\n* Query retries\n* Backup recommendations\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Query retries\"\n}\n[/block]\nIf 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.\n\nThe retried query should respect all the rules requested in the recommendations.\n\nThe associated configuration variables, that you can modify using [$p(\"init\")](doc:pinit), are as follows:\n\n* Config.sdk.backupQueryServer is a string specifying the backup query server. The default is \"//query1.petametrics.com\".\n* Config.sdk.retry is a Boolean specifying whether retries are enabled. The default is true.\n\nWe recommend contacting [Support](doc:support) to discuss any modifications you want to make to this configuration, so that we can suggest the best way to accomplish your goals.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Backup recommendations (rules not respected)\"\n}\n[/block]\nIf 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.\n\nThe 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.\n\nThe associated configuration variables, that you can modify using [$p(\"init\")](doc:pinit), are as follows:\n\n* Config.sdk.enableBackup is a Boolean specifying whether backups are enabled. The default is true.\n\nBackup 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.\n\nWe recommend contacting [Support](doc:support) to discuss any modifications you want to make to this configuration, so that we can suggest the best way to accomplish your goals.","excerpt":"","slug":"query-retries-and-backup-recommendations-javascript","type":"basic","title":"Query retries and backup recommendations (JavaScript)"}

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 [block:api-header] { "type": "basic", "title": "Query retries" } [/block] 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")](doc:pinit), 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](doc:support) to discuss any modifications you want to make to this configuration, so that we can suggest the best way to accomplish your goals. [block:api-header] { "type": "basic", "title": "Backup recommendations (rules not respected)" } [/block] 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")](doc:pinit), 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](doc:support) to discuss any modifications you want to make to this configuration, so that we can suggest the best way to accomplish your goals.