Closed chkpnt closed 2 years ago
We're already telling search engines that the current variant is the canonical source.
curl -I https://docs.spring.io/spring-boot/docs/2.6.2/reference/html/
HTTP/2 200
date: Wed, 19 Jan 2022 10:35:20 GMT
content-type: text/html; charset=UTF-8
link: <https://docs.spring.io/spring-boot/docs/current/reference/html/index.html>; rel="canonical"
Do you have a particular example of that? Could you share more details about this (link to search engine query, the result link you're getting)?
We are exploring a version switch in Spring docs (see Spring Security), but that involves a lot of changes and could also disrupt search engine results quite a bit.
Here for example:
And here an example which even links to a doc page of Spring Boot 1.3.1:
You're right, there is a canonical source:
curl -I https://docs.spring.io/spring-boot/docs/1.3.1.RELEASE/reference/html/howto-logging.html
HTTP/1.1 200 Connection established
HTTP/2 200
date: Wed, 19 Jan 2022 10:55:40 GMT
content-type: text/html; charset=UTF-8
x-mod-pagespeed: 1.14.36.1-0
link: <https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html>; rel="canonical"
Unfortunateley, I'm not a SEO guy, so I don't know why Google still prefers to deliver the 1.3.1 version in its search results. 🤷 I'm just suffering on a daily base. 😢
We're consistently adding those response headers and even support rewriting those links for some popular resources that have moved. We're basically applying Google's advice here.
Before closing this issue, I'll mark it for team discussion in case there's something else we can do.
Just scanned the article you've posted, in which Google suggests to use sitemaps as well:
Don't know if that's causing the issue, but I've just noticed, that the sitemap of docs.spring.io links to Spring Boot's sitemap, which isn't available (https://docs.spring.io/spring-boot/docs/current/reference/html/sitemap.xml). Some sitemaps of other Spring projects aren't available, too.
The sitemap suggestion seems to be a simpler but less efficient way of conveying the canonical source, so using it in this case might just make things worse since Google will be in charge of deciding what's similar and what's the canonical source.
I'm going to close this issue as there's nothing more we can do for now, long term we'll probably move to the documentation publishing tool Spring Security is using.
I suggest to configure the webserver for the documentation, so that only https://docs.spring.io/spring-boot/docs/current/ will be indexed by search engines, and not the version specific ones.
It is really annoying to end up on an outdated version of the documentation when using Google and Co.
An other idea would be to integrate a version switch within the documentation, as other projects like Ansible are using.