Skip to content

Post URLs intermittently serve ActivityPub JSON to browsers after upgrading to WordPress 7.1 (caching/content-negotiation regression) #3654

Description

@vincentbreton-auteur

Quick summary

Description

Since upgrading WordPress core to version 7.1 (ActivityPub plugin was already on 9.2.2, unchanged across the update), I've had a report from a reader that clicking a post link from Mastodon led to a raw JSON response (the ActivityPub representation) instead of the normal HTML post page. Reloading/clicking the link again shortly after showed the correct HTML page.

This did not happen before the WordPress core update to 7.1, on the same hosting/caching setup and same ActivityPub plugin version.

Environment

  • WordPress version: 7.1
  • ActivityPub plugin version: 9.2.2
  • PHP version: [si connue]
  • Hosting: o2switch, using XtremCache Varnish
  • Site: https://vincentbreton.fr

Steps to reproduce

Steps to reproduce

  • Publish a post
  • A Mastodon instance/client fetches the post URL shortly after publishing (presumably for a link preview / federation), sending an Accept header that may include both application/activity+json and text/html as a fallback
  • A human visitor clicking the same URL shortly after sometimes receives the JSON response instead of HTML
  • The issue resolves itself after some time (presumably once the cache entry expires or is refreshed by another HTML request)

Site owner impact

Fewer than 20% of the total website/platform users

Severity

Moderate

What other impact(s) does this issue have?

No response

If a workaround is available, please outline it here.

No response

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions