Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add X-Robots-Tag header to response for items marked as no_index #17

Merged
merged 3 commits into from
May 30, 2024

Conversation

sneridagh
Copy link
Member

No description provided.

@sneridagh sneridagh requested a review from davisagli May 20, 2024 10:08
@davisagli davisagli mentioned this pull request May 20, 2024
Base automatically changed from newaddonsetup to main May 21, 2024 17:49
@davisagli davisagli force-pushed the addXRobotTagsheadertoimages branch from 216bfeb to d10fa6c Compare May 21, 2024 17:54
@davisagli davisagli changed the title Add X-Robots-Tag header to images if they are marked as no_index Add X-Robots-Tag header to response for items marked as no_index May 21, 2024
@davisagli
Copy link
Member

davisagli commented May 21, 2024

@sneridagh I updated this to add the header for any item that has the behavior enabled and seo_noindex checked (not just images).

But I tested it in our project and I think it needs more work:

  1. The header is added to backend responses, but Volto's proxy and SSR does not pass it through.
  2. The header is added for the default view of the item, but not for related paths like ++api++ traversal or downloading image scales. I think we want to add it if an item with seo_noindex is the closest content item in request["PARENTS"], even if it's not the first item.
  3. This gets a bit more complicated, so I think some functional tests would be good.

@sneridagh
Copy link
Member Author

@davisagli

  1. fixed and released: https://github.com/plone/volto/releases/tag/16.31.9
  2. Why do we need the header in ++api++? the bots won't never search in there, nor parse the JSON in search for images.

@davisagli
Copy link
Member

@sneridagh Are you sure? In the logs from our project, I see traffic from Bingbot on API URLs.

@davisagli
Copy link
Member

@sneridagh Anyway, we definitely need it for image scales.

@davisagli davisagli merged commit c082861 into main May 30, 2024
6 checks passed
@davisagli davisagli deleted the addXRobotTagsheadertoimages branch May 30, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants