CMS Development

AMarsden4
Member

HubDB GraphQL query causing page to load slowly

Hi all,

I've noticed recently that the HubDB queries for our blog and experiments blog appear to load very slowly.

In some instances we're waiting for 3-4 seconds before the page loads. There aren't many render-blocking scripts on the page that would cause this, so I'm curious if something in the implementation is off.

Here's an example of our HubDB query for a blog page:

# $search: "{{ request.query_dict.search || ''}}"
# $topics: "{{ request.query_dict.topics || ''}}"
# $offset: "{{ request.query_dict.page ? (request.query_dict.page - 1) * 10 : 0}}"
# $blogGroup: "{{ content.content_group_id || ''}}"
# $authorPage: "{{ blog_author.id || ''}}"
# $tagPage: "{{ tag || ''}}"

query blogPosts($topics: [Number], $search: String, $offset: Int, $blogGroup: [String], $authorPage: [String], $tagPage: [String]) {
BLOG {
post_collection(
limit: 10
offset: $offset
orderBy: publish_date__desc
filter: {
name__icontains: $search
tag_ids__in: $topics
state__eq: "Published"
content_group_id__in: $blogGroup
blog_author_id__in: $authorPage
post_tag_slug__in: $tagPage
}
) {
items {
blog_author {
display_name
bio
}
blog_tags {
name
slug
}
featured_image
featured_image_alt_text
post_summary
url
name
publish_date
tag_ids
}
total
hasMore
}
}
}


We are using query_dict for filtering on different tags, but we had been using that for a while and weren't noticing any huge issues.


Any insights here would be much appreciated!

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

HubDB GraphQL query causing page to load slowly

Hi, @AMarsden4 👋 Thanks for your question. I hope your 20235 is off to a great start. I'd like to invite some of our community experts to the converstaion — hey @Teun @JBrake @Anton, do you have any experience here? 

 

Thank you very much for taking a look! — Jaycee


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
AMarsden4
Member

HubDB GraphQL query causing page to load slowly

@Jaycee_Lewis @Teun @JBrake @Anton Hey all, following up here. Any help is much appreciated. Thanks! 

0 Upvotes