Have Cloudflare cache public pages for non-logged-in visitors

I have a Mastodon instance running and must say that I love it! I have it running with cloudflare in front of the server.

My question is how can I get cloudflare to cache pages for users who are not logged in. For example, if a random (not logged in) user visits We FIGHT (@WeFIGHT@newsocial.tech) - Mastodon the page that they are shown is not in any way customized to them and so I would like for cloudflare to cache it. But right now it is being generated for each such visitor.

I’m thinking page rules in cloudflare will produce what I want, but I have no clue what rules to use. Any help would be appreciated. Thank you.

At this time, you cannot. There are cookies that are set by Mastodon even on public pages for non-logged-in visitors.
The cookies at least cover the language, but I think it also covered something else (on each page that features a form, it is used to prevent cross-site request forgery and sometimes spam, so even if the cookie was dropped for the language thing, /about would still send a cookie, not sure about a user page, though).

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.