大网数据广告活动
网站运营与故障问答

How to ensure image search optimization when hosting on a content delivery network?

· 52CE 我爱测

To improve my websites' user experience, I want to optimize site speed, as well as search engine ranking. Google stated that Improving web speed can benefit ranking in search engine results , but apart from that, search engine op…

问题原文

原帖链接 · Ingo Steinke · CC BY-SA 4.0

To improve my websites' user experience, I want to optimize site speed, as well as search engine ranking.

Google stated that Improving web speed can benefit ranking in search engine results, but apart from that, search engine optimization seems hard to measure. Most search engine optimization advice seems to be rather anecdotal than based on facts and measurements.

Following advice in a Lighthouse web page speed report, I started to "use a Content Delivery Network (CDN)" by deploying to Netlify. As I understand, content delivery networks help to reduce connection and transfer time by providing content from a nearby mirror server. Many also offer automated image optimization, reducing file size.

Deploying a website on Netlify with the asset optimization feature activated, images are automatically hosted on a CDN, rewriting image URLs to CloudFront subdomains instead of the original website domain.

During talks and discussions, web developers and search engine optimization professionals claimed that using CDN domains will harm efforts to make a website's images rank high in image search results. But they could not cite factual information to prove their claim.

As discussed earlier on StackOverflow, providing redirects to the new URLs should prevent a temporary drop from image search results.

It is not clear to me if there might be any other disadvantage of hosting images on a CDN. I asked the google community how to ensure image search optimization when hosting on a content delivery network, but I did not get an official statement from Google so far.

Please help me to solve this dilemma based on facts and evidence.

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

Having the image URL change to the CDN's domain is problematic for image SEO. You say that an example image URL is now https://d33wubrfki0l68.cloudfront.net/1cc7c854a3e57dd05ecaf7f6153d5736820f3d76/58b8a/img/ingo-steinke-portrait-2020.jpg while the original URL on your site is https://www.ingo-steinke.de/img/ingo-steinke-portrait-2020.jpg

  1. The image is no longer hosted on your domain.

    • This makes it much harder for Google to associate it back to your site reliably. If another site hot-links the image, it is just as likely as your site to appear in the image search results as the page hosting that image.
    • If you stop using the CDN your image URLs will all break and you will have no way to preserve the SEO of those images in image search.

    Rather than use a subdomain of the CDN, it would be better to use a subdomain of your own site. Assigning images.example.com to point to the CDN would alleviate many of the SEO concerns. Some (but not all) CDNs allow you to do so. For SEO, I would not use a CDN that hosts any of my content under its own domain.

  2. The image is still available on its old URL on your own site.

    • This creates duplicate content and splits your SEO between the two URLs. Google will only index one of the two URLs which are now competing with each other.
    • If your images had been ranking in image search before, they are likley to lose all their rankings. They are no longer linked from your site, so they have lost all their PageRank. Google will eventually start indexing the new URLs, but it could take weeks or months.

    When you change URLs, even for images, you should implement "301 Permanent" redirects from the old URLs to the new URLs. This will allow Google to preserve rankings from the old URLs. Because the old URLs are being used by the CDN as your origin server, you would need to use some special server side logic to allow the CDN to fetch the images, but return redirects for other clients such as Googlebot.

    It doesn't help that the CDN has added gibberish to the URL (probably a content hash). That means that redirecting the old URLs will be a one-by-one task rather than a simple rule for all the images. It would be better to find a CDN that allows you to use the same URL path that you used for the old URLs.

Images from CDNs can and do rank in Google image search. They and your site may get slightly better SEO from the performance benefits of the CDN. However, changing the image URLs for the CDN initially kills SEO. Now that the images are hosted on CDN URLs, you have vendor lock in with that CDN if you want to preserve image SEO when migrating away from that CDN.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2021-02-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。