有没有办法索引“Next/Image Component”生成的图像?在谷歌图片搜索中?

发布于 2025-01-13 16:03:19 字数 1170 浏览 3 评论 0原文

我在索引由 Next/Image 组件优化的图像时遇到问题,这些图像位于我的 Next.js 应用程序的公共文件夹中。

我还没有看到任何例子,其中由 Next/Image 组件生成的任何资源/URL(如下所示)已在谷歌图像搜索中建立索引。

这种类型的 URL: https://www.example.com/_next/image?url=%2Fimages%2Fhome%2FDog-image-1.jpg&w=384&q=100

这些的原因尽管 http 标头中具有资源内容类型: image/jpg ,但图像并未在 google 中编入索引,因为 google 需要在根文件/资源​​/URL 位置抓取资源,如下所示: https://www.example.com/images/home/Dog-image-1 .jpg

为什么? http 标头是否具有正确的内容类型?因为google需要确保它知道原始资源,因为它不确定Next/Image生成的URL将保留多长时间,并且它希望在其图像索引中避免此类URL或base64以避免404错误搜索引擎要保持满意的用户体验,就需要直接抓取其所在位置的图片资源,并且必须在html代码中抓取。

现在的问题是:

在使用 Next/Image 组件时,如何让 google 抓取我的 img 标签中的根资源/URL。如果这是不可能的,那么 Next/Image 根本不适用于电子商务或其他依赖大量图像搜索流量的图像相关网站,甚至其他网站也不愿意通过这些 URL 共享您的图像。

任何人都认为 data-src 属性可以解决这个问题或这里的问题 https: //nextjs.org/docs/api-reference/next/image#minimum-cache-ttl

感谢您抽出时间。

I am having issues with indexing the images that are optimized by the Next/Image component these images are in the public folder of my Next.js app.

I haven't seen any examples where any resource/URL like below, that was generated by Next/Image component has been indexed in google image search.

This type of URL: https://www.example.com/_next/image?url=%2Fimages%2Fhome%2FDog-image-1.jpg&w=384&q=100

The reason that these images are not getting indexed in google despite having the resource content-type: image/jpg in http header is because google needs to crawl the resource at the location root file/resource/URL like this: https://www.example.com/images/home/Dog-image-1.jpg

Why? If the http header has the correct content-type? Because google needs make sure that it knows the original resource because it is not sure how long the URL that is generated by Next/Image will stay, and it wants to avoid these kind of URL's or base64 in its image index to avoid 404 errors in the search engine to maintain a satisfactory UX, so it needs to crawl the image resource at it's location directly and it has to crawl it in the html code.

Now the question:

How is it possible to make google crawl the root resource/URL in my img tag when using the Next/Image component as well. If that's not possible Next/Image is not at all for e-commerce or other image dependent websites that depend on a lot of traffic from image search, even other websites would be reluctant in sharing your images via these URLs.

Anybody thinks a data-src attribute can solve this or something here https://nextjs.org/docs/api-reference/next/image#minimum-cache-ttl?

Thank You for Your time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦途 2025-01-20 16:03:19

我使用 https://nextjs.org/docs/api-reference/ 做到了下一个/图像#未优化

自 Next.js 12.3.0 起,可以通过使用以下配置更新 next.config.js 将此属性分配给所有图像:

module.exports = {
  图片:{
    未优化:真实,
  },
}

因此我有常规图像 URL https://www.example.com/images/home/Dog-image-1.jpg< /a>

I did it using https://nextjs.org/docs/api-reference/next/image#unoptimized

Since Next.js 12.3.0, this prop can be assigned to all images by updating next.config.js with the following configuration:

module.exports = {
  images: {
    unoptimized: true,
  },
}

And as a result I have regular image URL https://www.example.com/images/home/Dog-image-1.jpg

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文