Sitespeed help and can we move Hubspot JS & CSS?


#1

Hello... not a developer, so go easy on me. I am trying to reduce our site load speed and I guess I have two questions.

  1. Based on GTMetrix, it appears that we need to Minify our JS, combine images using CSS sprites, and Defer parsing of JS, and Leverage browser caching.
    In Google page insights, I get a similar story: defer offscreen images, eliminate render-blocking resources, properly size images.
    Where should I start?

  2. Can you move Hubspot specific JS & CSS to the footer? (Or remove any HubSpot server-side JS/CSS that isn't needed). I'm told that moving any JS & CSS to the footer will help with the load time but I'm confused as to whether we can move or mess with any hubspot JS or CSS.


#3

Hi @bshroyer, welcome! HubSpot does not allow for HubSpot specific JS or CSS files to be loaded anywhere besides where we normally inject them. This is because most dependencies we load rely on each other to function and must fire at the correct moment on page load. This thread: How to eliminate the render-blocking JS from Hubspot on my Wordpress site, and this thread Performance implications with integrating HubSpot explain a bit more about our files and why they are the way they are. Overall, you don't have any flexibility when it comes to HubSpot's default scripts and CSS, but HubSpot should be minifying almost every default CSS/JS file, or files hosted in the design manager.


#4

Thank you for the insight @Connor_Barley. I have read both articles. I'm a little at a loss then on how to achieve a faster site speed. My target is 6 seconds, but everything my developer tell me is that they're adjusting all that they can, but some JS & CSS is from Hubspot so there is nothing more we can do.

Any advice to increase the speed would be great.


#5

Hi @bshroyer I’m frankly not seeing a ton of room for improvement. The assets that Sitespeed tags in its suggestions are standard across all accounts (e.g. public_common.css, layout.min.css).

The content team is always looking to improve the performance and reliability of HubSpot assets like these, but the SiteSpeed tools are notorious for deducting points for each and every optimization that could be made. This doesn’t mean the optimizations necessarily should be made, however, as these tools don't necessarily know the role or dependencies of each asset. It kind of just points and says “This could be faster".

The other optimizations to our site and app assets are harder, and they are factors our product teams are constantly assessing.

I am seeing a few files in your File Manager that you could manually minify (hubspot only automatically minifies Design Manager hosted content), such as the fullPage jquery file at the top here (you can find it by searching the file manager for fullPage):