Performance implications with integrating HubSpot
We've recently integrated HubSpot on a client site & i have been spending some time trying to mitigate the performance hit from doing so. There are a couple of practices used by the HubSpot team that are causing me some issues.
Extremely short cache lifetimes:
There are several of your assets with extremely short cache lifetimes, likely causing a new download on every page view.
js.hs-scripts.com/2517056.js Having a 60 second cache window feels extreme to say the least. especially when viewed in the light of services like Google Analytics having a 1.4 hour window for their bootstrap script.
Similar could be said for
js.hs-analytics.net/analytics/1541674800000/2517056.js which has a 5 minute cache window, again something that could end up being requested by a user multiple times during a session.
js.hsadspixel.net/fb.js has a 10 minute cache window.
Extending the cache lifetime of the assets, even potentially using hashed URLs &
cache-control: immutable for the no bootstrap assets would have a positive impact on the site performance of your customers.
Splitting your assets up among multiple domains introduces even more overhead as each asset requires the full DNS lookup, initial server connection, SSL handshake before it can request & download the required asset. You are serving your assets from HTTP2 so your current practice of sharding isn't necessarily providing any benefit for download time.
Hosting all of your assets on a single domain would immediately remove this concern and allow site owners to preconnect to the domain without needing the concern of needing multiple preconnect tags causing priority issues with the rest of their assets.