(C) Alec Muffett's DropSafe blog.
Author Name: Alec Muffett
This story was originally published on allecmuffett.com. [1]
License: CC-BY-SA 3.0.[2]
WP Supercache seems to ignore non-default “Accept” header
2023-11-06 09:06:36+00:00
I am running WordPress 6.3.2 with Jetpack, Akismet, WP Supercache, AddToAny, and the ActivityPub suite, under NGINX
If I disable Supercache, my ActivityPub plugin works fine and my posts are visible to Mastodon, etc.
If I enable Supercache, they stop working, because as described at:
https://github.com/Automattic/wordpress-activitypub/discussions/446#discussioncomment-7332341
and also:
https://github.com/Automattic/wordpress-activitypub/discussions/446#discussioncomment-7332671
…when Supercache is enabled the page at
https://alecmuffett.com/article/author/alecm stops honouring the Accept: application/activity+json header, and returns cached HTML irrespective of the request for JSON.
I’ve tried it with Supercache in Simple mode, and with it in Expert mode although with the latter I have, of course, had to manually tune NGINX to tune the accelerated page fetches; this has been complicated by the apparent behaviour that even in Expert mode, Supercache seems to fall back to PHP/Simple caching in the event that the request was not served directly out of NGINX? If so, it seems like even a move to “Expert” caching and making NGINX ignore the static-cached page for that URL when Accept is not text/html , is doomed as a potential solution.
(update: I came to this conclusion because I switched on NGINX without modifying the NGINX config to serve cached pages direct from the filesystem… and I was astonished to find that I was still serving cached content. I’ve not tried debugging this before, but I presume that this means “when expert mode is enabled, simple/php-caching is still enabled as a fallback?” ; if so this makes it very hard to determine which mechanism is serving the cached content without (as I did) enabling NGINX low-level debugging.)
At the moment I have got Supercache switched off because it’s important to me that my ActivityPub work. I am happy to “Restore defaults” and debug that way if anyone wants.
This topic was modified 9 hours, 27 minutes ago by alecmuffett .
The page I need help with: [log in to see the link]
[END]
[1] URL:
https://wordpress.org/support/topic/wp-supercache-seems-to-ignore-non-default-accept-header/#post-17178338
[2] URL:
https://creativecommons.org/licenses/by-sa/3.0/
DropSafe Blog via Magical.Fish Gopher News Feeds:
gopher://magical.fish/1/feeds/news/alecmuffett/