Since this post, Marketo has started using CloudFlare themselves, so it's not usually pressing (and can be tricky) to use another CDN outside of that. I would only go down that road if you have a specific technical or performance goal.
Thanks Sanford, how can you load marketo assets through a CDN? Will this work if you are using non-marketo landing pages? We're trying to improve site speed performance and the highest priorities for Marketo are:
Leverage Browser Caching:
Enable gzip compression:
Thanks for your contribution on this subject!
- Hiram
Yes, you can load Marketo assets via a CDN from non-Marketo LPs, though it is not as straightforward since the paths are not relative (simply serving your LP domain via CDN includes all relative paths as well).
But don't overreact to claims like "expiration not specified." Automated testing tools want to be as alarmist as possible, but they are often incorrect. "Not specified" doesn't mean "not cached." It means the browser heuristically caches the assets according to its own internal algorithm. You can see easily in your Dev Tools that such assets are still loaded from your local computer's cache, and passing them via CDN, for a single end-user, would not make them any faster. Caching assets at the CDN has benefits for other users, but that is not exactly the same question.
So if you're already using a CDN for your LP domain, your marketo assets are already being cached and delivered along with your other assets? LP: http://www.cpcstrategy.com/amazon-a-content-guidebook-brands/
Anything we can do in regards to gzip compression on Marketo files?
So if you're already using a CDN for your LP domain, your marketo assets are already being cached and delivered along with your other assets? LP: http://www.cpcstrategy.com/amazon-a-content-guidebook-brands/
Only if the assets use relative URLs: href/src attributes that begin with a single slash ("/folder/subfolder/page") or a partial pathname (like "folder/page").
When URLs begin with double slashes // or with a protocol, they do not use the main document's hostname, they use the hostname that's explicitly present in the URL.
On Marketo-hosted LPs, assets like the Forms2 library load from a relative URL, so if the main document loads via CDN, then so do those assets, automatically.. (That's the default behavior, but it can be advantageous to change it in other scenarios that I'm getting into in an upcoming blog post.)
On non-Marketo LPs, Marketo assets can't load from a relative URL, thus even if the main document is CDNed that doesn't automatically propagate to the assets.
Gzipping dynamic assets like form descriptors can actually add more overhead (the server-side compression component is not instantaneous) than the bytes on the wire cost you in network overhead. Be aware that the response to getForm? is recomputed every single time it is requested: if this were not done, then you couldn't update a form and have the update take effect around the world instantly. I can't say whether the overhead of constant gzipping is worth saving 3500 bytes on the wire, but there's a good chance that it would work in the other direction, depending on server horsepower.
Thank you for response!