HubSpot Ideas

Jon_McLaren

PageSpeed scores for HubSpot sites are low due to hubspot not following best practices for speed.

All HubSpot sites are getting dinged on pagespeed for renderblocking javascript and CSS in the header. This can be mitigated if hubspot were to by default load:

asynchronously or allow us to {%include%} it into our css styles. 

In addition HubSpot could also minify the html on the server side automatically.

 

There may be other methods HubSpot could use to improve their score, but overall of the top partner agencies using hubspot most score between 20 and 55 out of 100 in pagespeed tests. 

The biggest factor google seems to be dinging for is jquery being in the header and the multiple required css files.

13 Replies
Jon_McLaren
Top Contributor | Platinum Partner

Why has this not been addressed still? This is a serious competitive disadvantage for HubSpot.

PatrykJ
Contributor

I agree. And jquery should be moved to footer:

<script src="https://static.hsstatic.net/jquery-libs/static-1.4/jquery/jquery-1.11.2.js"></script>

 

VictoriaGumaer
HubSpot Product Team

This is something the product team at HubSpot is actively investigating for our users.

nq
Contributor

Any updates on this? We are in an ultra-competitive niche where page load times is key

Qt
Contributor

@VictoriaGumaer We have had reports that our HS site is at times causing 100% CPU load. We've been troubleshooting this. Could this be related? 

VictoriaGumaer
HubSpot Product Team

@Qt the jQuery includes should not be causing 100% CPU load for your website.  You should be able to use Google's development console to glean more information about resource requests and load for elements on your site.

Other Updates:
We did recently release a combined css feature which has improved PSI scores for many customers and we're going to continue to explore ways to allow our customers to have more control over where assets are included and referenced in their HubSpot hosted content. 

PatrykJ
Contributor

You can do something like that:

 

{{ standard_header_includes|cut('https://static.hsstatic.net/jquery-libs/static-1.4/jquery/jquery-1.11.2.js')|cut('https://static.hsstatic.net/content_shared_assets/static-1.4049/css/public_common.css')|cut("hsjQuery = window['jQuery']") }}
...
{{ standard_footer_includes|cut('https://static.hsstatic.net/content_shared_assets/static-1.4049/js/public_common.js') }}

to remove .js and .css which you don't need.

 

 

There is a plenty of problems with HubSpot if you want to build a good website. You need hacky solutions and there are still issues which you can't solve, btw you can't use service worker. ;/

And this is my score, which I have finally achived on the HubSpot page.

382095af-1bca-4b9c-a7d8-a39a556121d7

 

Jon_McLaren
Top Contributor | Platinum Partner

HubSpot Developers announced they are starting a beta for this.

Jon_McLaren
Top Contributor | Platinum Partner

Hey all updating that HubSpot is actively working on this, but will require you to manually flip a toggle to move jQuery.

If you'd like to test how it will work on your site you can use this chrome extension to test: https://spin.d.pr/Gy12XS

ravenousblue
Participant

How can I move jquery? Getting dinged on mobile site speed in HubSpot especially with the lighthouse update!

Jon_McLaren
Top Contributor | Platinum Partner

go under account settings and check the checkbox move jquery to footer. Before you do that though you should test your whole site to make sure that moving it wont break everything.
You can use the HubSpot Developer Chrome Extension to easily test it. https://chrome.google.com/webstore/detail/hubspot-developer-extensi/gebemkdecnlgbcanplbgdpcffpdnfdfo

ravenousblue
Participant

Thanks. I updated to 1.11x jQuery however when I attempt to Load jQuery library from the footer, I lose my site's Hero image and footer module. Any ideas why? I am running on the CLEAN 4 Template Pack.

Jon_McLaren
Top Contributor | Platinum Partner

if javascript in the head is expecting jquery to be loaded in the head things will break. basically the jquery script has to be loaded above all javascript files that depend upon it.