Using different caches based on header

What is the name of the domain?

meta.miraheze.org

What is the issue you’re encountering

We are trying to differentiate the cache based on if it’s mobile and desktop. To do this we want to use a X-Subdomain header which gets set to M if on mobile or empty/unset on desktop. We do this Extension:MobileFrontend/Configuring browser auto-detection - MediaWiki in varnish Which our live config is: puppet/modules/varnish/templates/default.vcl at master · miraheze/puppet · GitHub and puppet/modules/varnish/templates/default.vcl at master · miraheze/puppet · GitHub. I’m having problems doing this in CF. We are on the enterprise plan.I tried setting it in modify request header which adds the header but the cache doesn’t work the way I expect it to. I have tried snippets which now it doesn’t cache. So it works changing between mobile and desktop but it’s not cache so it’ll hit the backend…

So essentially how I was trying to do this is:

  • Create a modify request header rule to add X-Subdomain if it matches the criteria.
  • Create a cache all rule and then added the x-subdomain to include header

None of this changed the cache. You can see that at 100% free, ad-free wikis, request yours today! - Miraheze. click on mobile view on the footer and then click on the logo or the site name “meta”. The mobile view should be shown instead desktop is.