-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API queries from UI almost 2 times slower than direct queries #936
Comments
It's -H 'includefacets: true' that adds the additional time. I would make an additional query to request facets separate from the original one so the difference is not visible to the user. |
@snyaggarwal it seems like a quick fix, doesn't it? |
@rkorytkowski I will check this out |
@rkorytkowski this is done. |
I see that web requests facets even when paginating only. Is that needed? |
nope, I will fix that |
Asynchronous query run by UI from Chrome:
curl 'https://api.staging.openconceptlab.org/mappings/?q=&page=1&exact_match=off&limit=25&includeRetired=false&verbose=false&sortDesc=_score' -H 'authority: api.staging.openconceptlab.org' -H 'sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"' -H 'accept: application/json' -H 'sec-ch-ua-mobile: ?0' -H 'includefacets: true' -H 'user-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36' -H 'content-type: application/json' -H 'origin: https://app.staging.openconceptlab.org' -H 'sec-fetch-site: same-site' -H 'sec-fetch-mode: cors' -H 'sec-fetch-dest: empty' -H 'referer: https://app.staging.openconceptlab.org/' -H 'accept-language: en-US,en;q=0.9,pl;q=0.8' --compressed -o /dev/null -s -w 'Total: %{time_total}s\n'
Query directly executed in Chrome:
curl 'https://api.staging.openconceptlab.org/mappings/?q=&page=1&exact_match=off&limit=25&includeRetired=false&verbose=false&sortDesc=_score' -H 'authority: api.staging.openconceptlab.org' -H 'cache-control: max-age=0' -H 'sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"' -H 'sec-ch-ua-mobile: ?0' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' -H 'sec-fetch-site: none' -H 'sec-fetch-mode: navigate' -H 'sec-fetch-user: ?1' -H 'sec-fetch-dest: document' -H 'accept-language: en-US,en;q=0.9,pl;q=0.8' -H 'cookie: _ga=GA1.2.1552851037.1629461705; _gid=GA1.2.2139365053.1629461705' --compressed -o /dev/null -s -w 'Total: %{time_total}s\n'
Notice the URL is the same but some HEADERS differ.
The text was updated successfully, but these errors were encountered: