Hi!
When I try to embed any Tweet on my webpage, the Twitter always downloads several JS files. I kind of understand that but when I embed like 10 tweets then all those scripts are downloaded 10 times! I use twttr.widgets.createTweet function but it seems to be thing for any way to embed.
In the most extreme case it’s something like here https://www.sportsnet.ca/hockey/nhl/twitter-reaction-washington-capitals-alex-ovechkin-win-stanley-cup/ with a hundreds of scripts. Is that normal state or is there any way how to change that?
Thanks!
You only need to include the widgets.js script once in a page, maybe somewhere in a footer, so that the blockquote html elements load, and they’ll all be processed, you do not need to include the script for each embed.
I’m not talking about the main script but about the scripts the Twitter is downloading during the tweets rendering.
1 Like
A7rRay
#4
If you have multiple embeds on a single page then it will generate an iframe for each embed. That is probably what you are seeing.
Okay but is there any reason why all those same scripts are not cached?