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: 10offset: $offsetorderBy: publish_date__descfilter: {name__icontains: $searchtag_ids__in: $topicsstate__eq: "Published"content_group_id__in: $blogGroupblog_author_id__in: $authorPagepost_tag_slug__in: $tagPage}) {items {blog_author {display_namebio}blog_tags {nameslug}featured_imagefeatured_image_alt_textpost_summaryurlnamepublish_datetag_ids}totalhasMore}}}
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!
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
@Jaycee_Lewis @Teun @JBrake @Anton Hey all, following up here. Any help is much appreciated. Thanks!
Hi @AMarsden4
It’s a HubSpot GraphQL query. Since HubSpot has to evaluate multiple conditions and filters before returning the blog posts, the query can take some time to process. In particular, the “name_icontains” filter requires HubSpot to search the post title for a matching substring.
Because the GraphQL query is being processed before the page is fully rendered, the browser has to wait for the response before displaying the page.
To improve the rendering time, I would recommend adding more specific filters—for example, ensuring that only published posts are queried, along with any other relevant parameters that can narrow down the result set. This should reduce the amount of data HubSpot needs to evaluate and may improve the overall page load time.
I hope this helps you out. Please mark it as Solution Accepted and Like to help another Community member.
This post was created with the assistance of AI tools
Thanks!
Hi, @AMarsden4
Since this was working fine before, I’d start by checking whether anything specific in the query is causing the delay. You’ve got a few filters running together, so try removing name-icontains and the tag filters one at a time and compare the timings. That should give you a better idea of where the slowdown is coming from.
I’d also check the request in DevTools under the Network tab. If the response itself is taking 3-4 seconds, then the delay is happening before the page finishes rendering, so changing render-blocking scripts probably won’t make much difference. It’s worth checking whether both blogs are affected and whether the same thing happens when you load the page without any search or tag filters.If the query is still slow, try returning only the fields you actually need for the blog listing and see if that makes a difference.
Note: I wrote this myself and used AI to tidy up the wording.