MediaWiki:Configure-setting-wgVaryOnXFP/en

Add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API requests and RSS/Atom feeds