I am trying to optimize a Wordpress site that has some Amazon Affiliate iframes on it. Those iframes are those that you can get on the left corner of Amazon -> Obtain link -> Text + Image when you are on a specific product to obtain an affiliate link of it:
and this is how they look like (as typical Amazon affiliates iframe):
My question comes because when I run a test on PageSpeed, it shows me "Enable text compression" error that makes references to all the urls from the iframes:
My hosting have CPanel so I have enabled Text Compression on cPanel --> Optimize Website --> Mark "Compress All Content" option but it is still showing the error, so it doesnt seem it takes any effect on them.
Is there a way to optimize those iframes and enable text compression on them? It is a bit annoying that it takes so much time to load all of them (and they are between 15-20).
You can add lazy load to your Iframe to increase page speed. Refer this link to implement lazy load for iframes in Wordpress https://web.dev/iframe-lazy-loading/#wordpress
<iframe
loading = "lazy"
style="width:120px;
height:240px;"
marginwidth="0"
marginheight="0"
scrolling="no"
frameborder="0"
src= {amazon link}>
</iframe>