-3

Say, instead of saving Boolean in database, i'll just make client side of webapp check if image exists and if so, then display it, otherwise - default image.

  1. Are there any negative consequences? For SEO?
  2. What if i'll not even bother about "check if exists requests"? I'll just put default image beneath the desired one and if image is not exists, then client-side js will remove the remains of the image tag.
Community
  • 1
  • 1
stkvtflw
  • 12,092
  • 26
  • 78
  • 155

1 Answers1

1

Default image behind broken image linke: I can't find a reference but I suspect Google might give a tiny penalty for broken image links.

A good way to do your "show default image if ideal image doesn't exist" is lazy-loading, and there are libraries to do it: you set all your images to start out as your default image, and then tell the library to go and fetch the real image. So just pick a library that fails gracefully and does nothing if the real image doesn't exist. Here's one that looks promising:

http://dinbror.dk/blog/blazy/

(Don't be put off by all the bells and whistles - for your case, implementation will be very simple. There's bound to be other simpler libraries out there.)

As to SEO penalties/benifits of lazy-loading, see: https://webmasters.stackexchange.com/questions/61761/lazy-loading-images-and-effects-on-seo However note that the answer is outdated. These days google runs scripts, so should be able to index the images.

Lazy loading and SEO: see also: http://dinbror.dk/blog/lazy-load-images-seo-problem/

Edward D
  • 521
  • 3
  • 9