Open rjyo opened 4 years ago
I have been thinking it should be possible to check for the embeds server-side as well. Add a flag to the pages when embeds are processed.
I am a little afraid to check for things like blockquote.instagram-media
as they might change the html we get back from their endpoints at any time.
We might secretly add the elements to options, so if they break user can fix it by overriding the elements without having to wait for us to fix it.
Just following up on this PR. I like the idea of this as we should only be loading scripts that we require. Is this something you still want to work on @rjyo?
Problem: When not all the pages need embedding, using SSR to add the scripts (on all pages) will damage the whole site's speed score (benchmarked with Google's PageSpeed Insights).
Solution: This PR will move the SSR injected scripts to the client side. As thus they will only be loaded on the pages(blogs) with embeds.