CMS Development

icheshire
Participant

get_asset_url is returning two different things

I wanted to preload my main.css file, so I put a <link rel="preload"> early in the <head> and the call to the CSS file later. Both use get_asset_url. The preload one returns a hubspot CDN link, but the actual link to the CSS file returns one hosted on my domain. How can I use the same for both?

0 Upvotes
4 Replies 4
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

get_asset_url is returning two different things

Hi @icheshire 

 

As far as I'm concerned it has a minor improvement your Page Speed Insights score using your domain rather than HubSpot CDN Domain. 

 

I don't know of any down sides (it's the same CDN as far as I know).

 

Cheers

Mike

Disclaimer: I'm a HubSpot Partner, not a HubSpot employee.

0 Upvotes
icheshire
Participant

get_asset_url is returning two different things

Thanks! It doesn't seem to have worked for my purpose unfortunately

0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

get_asset_url is returning two different things

Hi @icheshire 

 

I would check the [well hidden] "Default file hosting domain".

 

Got to Settings (Cog top right) > Website (Bottom Left) > Pages (Sub menu) > SEO & Crawlers (Tab).

 

There you can change your "Default file hosting domain".

 

The default is "HubSpot CDN" but if you change that to your domain then you should see more consistent results.

 

Did that help?

Mike

 

p.s. I'm not sure if this setting is available for all tiers/plans

icheshire
Participant

get_asset_url is returning two different things

Thanks! Is there any disadvantage to changing the file hosting domain?

0 Upvotes