Enable file caching for anonymous users via caddy souin - #432
Conversation
|
LGTM but do you mind syncing the merge conflicts? Also what are your thoughts on @danthedaniel 's suggestion of triggering off one cookie rather than the whole four? |
| order cgi last | ||
| order authenticate before respond | ||
| order authorize before basic_auth | ||
| order cache before rewrite |
There was a problem hiding this comment.
rewrites are the internal/transparent redirects. I think we want caddy to rewrite urls, then hit the cache. It's at least fewer cache entries to return the same pages. I don't think rewrite is an expensive operation. Where does this decision come from—souin docs? llm?
| not header Cookie *wiki_wiki_UserID* | ||
| not header Cookie *wiki_wiki_Token* | ||
| not header Cookie *wiki_wiki__session* | ||
| not header Cookie *wiki_wiki_mwuser-sessionId* |
There was a problem hiding this comment.
Noting: this cookie does appear on first anon request to Special:RequestAccount.
Articulating as much for myself as others, we need to address at least:
- logged out / anon users
- logged in users
- check sign-up / request account flow
| } | ||
| {{ noisebridge_caddy_secure_header | indent(width=2) }} | ||
|
|
||
| @claudebot { |
| not header Cookie *wiki_wiki_mwuser-sessionId* | ||
| } | ||
| respond @claudebot 403 | ||
| header @anon Cache-Control "public, max-age=7200" |
There was a problem hiding this comment.
I want to confirm—lay out the reasoning, and what needs to be checked—for how this interacts with $wgFileCache
for logged in and anonymous users. Avoid accidental cache compounding. The session cookies do seem to match the definition.
There was a problem hiding this comment.
mw:Manual:$wgCdnMaxAge defaults to 5 hours, 18000. I pushed for shorter default, I'm fine with their longer default.
@danthedaniel this uses redis and souin for caddy-level caching. it uses redis and in-memory cache. also 2 hour timeout. This is all using
https://docs.souin.io/docs/quickstart/