Skip to content

SEO and Images: the src URL changes at every build whenever you change max-width property #13742

Description

@fsgreco

Summary

I fond that whenever I change the max-width property within the graphql query that gets the image, it slightly changes the URL of the source on the build. Despite the name of the image is the same.

Here is an example of how the URL changes

when I have the same image with (maxWidth: 1400):
photo_2019-04-30_12-44-45

And here with maxWidth: 1500:

photo_2019-04-30_12-44-48

From a SEO perspective it is not recommended to change the URL of the main "src" attribute inside img element. It's like telling Google that now there is a completely new images. (indeed this is also not recommended by Google (source1, source2)

For this example I use gatsby-source-wordpress but I think that this behavior is global and has to do with how webpack handle the images.

This is the query used for this example. The only change regards the maxWidth proprierty.

acf {
	img_copertina {
		localFile {
			childImageSharp {
				fluid(maxWidth: 1400){
					...GatsbyImageSharpFluid_tracedSVG
					src
				}
			}
		}
	}
}

Expected Behaviour

Since the image hasn't change it's name its url should remain the same even when it changes quality or width.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions