fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

Fish in the Percolator

Using with the plugin and seems like it's not playing well with , as the author page that should return an ActivityPub author JSON for an author page, just being cached (not bothering about the "Accept" header).

Solved it by just exempting the `/author/.+` paths from caching, but it is not satisfying, the cache plugin should be able to handle these things.

Also, I have no clue whether it will make any difference for @gergely at all :P

And after poking around this area to see what the author page, plugin, the endpoint returns, a side-quest is now a deep-dive into an old-ish article from @Gargron to try start to piece things together
blog.joinmastodon.org/2018/06/

(while still it is just nerding out, not sure if it will have any specific effect)

Mastodon BlogHow to implement a basic ActivityPub server
More from Eugen Rochko

Now further rabbit hole of looking at various instance's Instance endpoint docs.joinmastodon.org/methods/, e.g. this very instance's: fosstodon.org/api/v2/instance but also others like @grafana's
grafana.social/api/v2/instance and discovering Mastodon Glitch edition glitch-soc.github.io/docs/
and a reminder of how images are blurred here for loading using blurha.sh/ that looks pretty cool and would love to understand the process / see if it can be used well in code I maintain.

docs.joinmastodon.orginstance API methods - Mastodon documentationDiscover information about a Mastodon website.

Plot thickens with and plugins interactions. Seems like W3TC's config is subtly wrong for me multiple ways so it didn't actually direct caching (and it was red herring to modify it, wasting me a an hour or two), but W3TC's internal code redirects to the right generated on-disk file after all (so that's why the "caching" seemed to have worked even with emptied nginx config).

So now:
1) my caching was pretty busted before this (not _really_ bypassing PHP) 🙀

2) making these two plugins to share the work (accept:json to ActivityPub, anything else to W3TC) is unlikely,

3) at this point disabling page cache seems the right thing to do (there's still object cache which seems to work correctly for both).

I'm maybe just missing a benchmark to see the effect of these settings...

@imrehg @gergely Are you able to add Accept to the Vary header?

@evantd what sort of settings change this would be? I'm using and adds its own config to it (as a generated file that is imported by the main nginx setup). Looking at it, no headers or accepted file types related logic in there.
Any other hints about what do you mean?

@imrehg I haven't configured any of the software you're using, so I don't know. I think you'd probably want it set as close to the origin at possible.

@imrehg @gergely Sounds like the activitypub script that 'renders' those jsons are missing the DONOTCACHE (or similar) global ;-)
Or you might wanna set up fragmented caching for those pages. #idea

@arnandegans so the plugin would need to tell somehow the whole instance (or just ?) not to cache the authors' about page. (when it receives a regular query, return the HTML version, if "application/activity+json" type the the plugin take care of it.

It's an interesting proposition whether that plugin could set up that behaviour. I wonder if it's something down this line: wordpress.org/support/topic/di (and thanks for the hint, it seems promising!)

WordPress.org ForumsDisable caching for a specific page[This thread is closed.] Hello and thanks for the wonderful plugin! this might be a dumb question, but I haven’t been able to exclude a page…

@imrehg w3tc supports a thing called fragmented caching, which lets you exclude bits of a page from caching, for example a specific function while the header and footer are cached.
Alternatively you can have any piece of PHP define a global called DONOTCACHE to not cache that page. I use those methods in my plugin to rotate specific ads in an otherwise cached page.
My guess is that the activitypub plugin doesn’t do either and thus gets stuck while generating those json files.

@arnandegans I've looked deeper, and it seems a bigger issue really: the ActivityPub plugin renders authors, posts, and homepage as a compatible JSON if the accept header is added. I tried and can indeed set "DONOTCACHEPAGE" for these and it works as intended - for ActivityPub, but in fact then the cache plugin is completely useless (almost nothing is cached).
I looked at fragment caching but that also seems different github.com/BoldGrid/w3-total-c

GitHubFAQ: DevelopersContribute to BoldGrid/w3-total-cache development by creating an account on GitHub.

@arnandegans given my understanding how the nginx rules and page cache works, I think W3TC having a "bypass page cache for these headers" would be more to the point? Since once page cache is generated once, ideally the web request doesn't even touch wordpress just loads from disk, so no amount of wordpress code can change it unless the redirect rules allow.

@imrehg No idea, I'm not familiar with Nginx. But if that header works, that'll be fine of-course.

@arnandegans yeah, it was indeed. It turned out though that the plugin's generated nginx settings were such that it didn't actually control caching after all (so changing it had no effect on the final outcome). Wild goose chase if I've ever seen one. 🦆 Oh, well.

@imrehg yeah, so this is a widespread problem with just about all caching, especially for WordPress sites. @jasontucker had some major problems when using #Cloudflare in front of his #WordPress site. I have odd issues as well with #OpenLiteSpeed caching in front of my site.