On my site I am embedding a simple twitch and chat embed, using the following html:
<div class="twitch">
<div class="twitch-video">
<iframe
src="https://player.twitch.tv/?channel=mychannel&parent=www.mysite.com&autoplay=false"
frameborder="0"
scrolling="no"
allowfullscreen="true"
height="100%"
width="100%"
title="Twitch Video Embed">
</iframe>
</div>
<div class="twitch-chat">
<iframe
frameborder="0"
scrolling="no"
src="https://www.twitch.tv/embed/mychannel/chat?parent=www.mysite.com"
height="100%"
width="100%"
title="Twitch Chat Embed">
</iframe>
</div>
</div>
I am then pre-loading the script:
<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
(preload at top)
This simple embed however, according to gt-metrix:
- Increases full page load time from <2 seconds, to 23.5 seconds
- Increases total page size from <900kb to 3.54MB
- Increases requests from around 20, to 120+
This just seems absolutely insane for a simple embed, and I’ve got no idea if it’s just me using it wrong, or the twitch embed is just like this? Any help appreciated, thanks.