Skip to content

Enable file caching for anonymous users via caddy souin - #432

Open
jetpham wants to merge 1 commit into
masterfrom
jet/caching_souoin
Open

Enable file caching for anonymous users via caddy souin#432
jetpham wants to merge 1 commit into
masterfrom
jet/caching_souoin

Conversation

@jetpham

@jetpham jetpham commented Feb 17, 2026

Copy link
Copy Markdown
Member

@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/

@jetpham jetpham self-assigned this Feb 17, 2026
@ElanHR

ElanHR commented Feb 17, 2026

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let claudebot back in!

not header Cookie *wiki_wiki_mwuser-sessionId*
}
respond @claudebot 403
header @anon Cache-Control "public, max-age=7200"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mw:Manual:$wgCdnMaxAge defaults to 5 hours, 18000. I pushed for shorter default, I'm fine with their longer default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants