leeoniya / notyet

Lazy image & media loader
MIT License
14 stars 1 forks source link

Instant loading for SEO? #1

Open collinsethans opened 5 years ago

collinsethans commented 5 years ago

@leeoniya I have a query regarding this feature: Supports SEO by instantly loading for common bot user-agents.

Will we need this if we have noscript support for images?

leeoniya commented 5 years ago

It's fair to say that any publicly available info about how Google or Bing index pages becomes stale every several months. I don't know exactly how they're behaving this season :)

That being said, GoogleBot runs with JS enabled, and [as of recently] uses an evergreen Chrome version [1]. Given how few people browse without JS these days, if i were a js-capable bot, I'd treat <noscript> content similarly to aria tags and other accessibility-related markup. @malchata's test file [2] includes <img> tags in <noscript>s but yall's docs [3] don't imply that it's for bots. At the end of the day, I'd recommend testing it using official tools [4][5].

[1] https://searchengineland.com/google-will-ensure-googlebot-runs-the-latest-version-of-chromium-316534 [2] https://github.com/malchata/yall.js/blob/master/test/index.html#L149 [3] https://github.com/malchata/yall.js#what-about-users-without-javascript [4] https://search.google.com/test/mobile-friendly [5] https://www.google.com/webmasters/tools/googlebot-fetch

collinsethans commented 5 years ago

Thanks for your thoughts on this.

I was testing using 'url inspection' in Google Search Console. I noticed very random results. Sometimes, even CSS/JS are not loaded, many images are not loaded and that's very random. (We are using Cloudfront and we never faced such issues before though) I am guessing there's probably some issues/constraints with the 'URL Inspection'.

I tried with mobile friendly test (your #4). It's fine with above the fold images but doesn't allow to scroll to view below and doesn't show any error logs either.

leeoniya commented 5 years ago

from what i understand, there are several interations/stages of indexing/crawling, so who knows. maybe check your server logs in a day or two to see if the bot comes back and grabs more stuff than the first time 🤷‍♂

https://seopressor.com/blog/javascript-seo-how-does-google-crawl-javascript/

leeoniya commented 5 years ago

really, the best solution for SEO is to detect the bot user agent server-side and simply serve images with a proper src. everything else is going to be a crapshoot.