wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

List of all the routes required?

Open antranigv opened this issue 3 years ago • 3 comments

Hi there! First of all, huge love to everyone involved in this project, it brings hope to the web!

My question is simple: Is there a list for all the routes that this plugin requires?

The reason why I'm asking is because I have a caching plugin (WP Rocket I think) and I'd like to disable caching in those routes, otherwise it's breaking.

Thanks in advance!

antranigv avatar Jul 08 '22 08:07 antranigv

Good point, I will collect all routes and send you the list, but I will also add this info to the settings page.

pfefferle avatar Jul 08 '22 10:07 pfefferle

And I am glad you like the plugin ☺️

pfefferle avatar Jul 08 '22 10:07 pfefferle

@antranigv it's working for me so far with this rule in nginx and fastcgi cache

# Skip cache if requesting json file (ActivityPub)
if ($http_accept ~* "application/ld\+json|application/activity\+json|application/json") {
        set $skip_cache 1;
}

and then later set fastcgi_cache_bypass and fastcgi_no_cache to $skip_cache. I've never used WP rocket, but maybe it also lets you bypass the cache based on header rules? In plain language the rule says:

Bypass the cache if the Accept header contains application/ld+json OR application/activity+json OR application/json.

I'm not sure if this causes issues in edge cases though.

mwt avatar Sep 25 '22 13:09 mwt

Good point, I will collect all routes and send you the list, but I will also add this info to the settings page.

I'm just getting started with this and think another caching plugin (WP-SuperCache) has been causing me some headaches, so I would also be interested in a list of routes or better information about how to avoid problematic cache interactions. Thanks 👍🏻 excited to use this to have our site join the Fediverse!

andypiper avatar Oct 29 '22 22:10 andypiper

I think that any cache plugin will break it for sure if you don't exclude things. The plugin requires posts and author pages to be served in json when requested with the headers I mentioned. If you cache those pages as json, they won't be human readable and if you cache them as html, they won't be readable by AP instances.

You need to either bypass the cache or use a separate cache token when these headers are present. I know how to do that with fastcgi and Cloudflare, but I don't know about other plugins.

mwt avatar Oct 29 '22 23:10 mwt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 27 '23 03:02 stale[bot]

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 04 '23 01:10 github-actions[bot]

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Feb 02 '24 01:02 github-actions[bot]