tterb / gatsby-plugin-disqus

:speech_balloon: A plugin for adding Disqus comments to GatsbyJS
https://brettstevenson.io/gatsby-plugin-disqus
MIT License
45 stars 5 forks source link

Defer disqus script/iframe loading #32

Open Linda-Ikechukwu opened 4 years ago

Linda-Ikechukwu commented 4 years ago

Having the disqus iframe load at the same time really puts a dent on the page loading time. Is there a way to expilicity define that the script should load in defer or async?

tterb commented 4 years ago

@Linda-Ikechukwu If you take a look here you can see that the Disqus scripts are already being loaded asynchronously and I don't believe that deferring the script would necessarily have the intended effect. There could be some benefit to having the option to lazy-load the components, but that would be dependant on finding an implementation that is generic enough to work with the majority of use-cases.

Feel free to submit a PR if you're interested in taking this on. Otherwise, I can try to look into potential solutions.

Linda-Ikechukwu commented 4 years ago

Ok, Thank you @tterb . I'll do some research and see if I can come up with a pull request. I'll keep you in the loop