Skip to content

Adds caching-proxy configuration support (MW_PROXY_SERVERS)#514

Merged
vedmaka merged 1 commit intowikiteqfrom
IEEE23-45
Jul 25, 2025
Merged

Adds caching-proxy configuration support (MW_PROXY_SERVERS)#514
vedmaka merged 1 commit intowikiteqfrom
IEEE23-45

Conversation

@vedmaka
Copy link
Collaborator

@vedmaka vedmaka commented Jul 24, 2025

Adds new ENV variable MW_PROXY_SERVERS that allows setting front-running caching proxies:

  • The value can be a single server or many servers, i.e,. MW_PROXY_SERVERS=varnish if you're running varnish on the same stack
  • Once set, it enables $wgUseCdn, populates $wgCdnServers, enables $wgUsePrivateIPs to make the wiki send PURGE requests to the proxy servers
  • Additionally, it installs a LinksUpdateComplete hook that re-warms the proxy cache once the PURGE was performed to avoid cold hits

@github-actions
Copy link

🐳 The image based on 7dbb17dc commit has been built with 1.39.11-20250724-514 tag as ghcr.io/canastawiki/canasta:wikiteq-7dbb17dc

@vedmaka vedmaka merged commit 9a0277f into wikiteq Jul 25, 2025
3 of 4 checks passed
Copy link
Member

@DanielWTQ DanielWTQ left a comment

Choose a reason for hiding this comment

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

2 minor suggestions but this has already been merged, just noting for the record

}
};
}

Copy link
Member

Choose a reason for hiding this comment

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

we should unset( $tmpProxy ); to avoid the global variable polluting things

],
'proxy' => $server
];
MediaWiki\MediaWikiServices::getInstance()->getHttpRequestFactory()
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest using the fully qualified \MediaWiki\...

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.

2 participants