Page MenuHomePhabricator

Is there anyway to convert Cache-Control header in pages from private to public?
Open, Needs TriagePublic

Description

Hi,

The Cache-Control header for Mediawiki pages was designed to be : private, s-maxage=0, max-age=0, must-revalidate since 2005 or even earlier, for each page to show anonymous user's IP, which is documented here: https://wikitech.wikimedia.org/wiki/MediaWiki_caching#Cache_headers. Such desgin does make sense with the old design that show user's IP for each user.

However, The display of anonymous user's IP was removed in Mediawiki 1.27 in 2015. Therefore every anonymous users now get exactly same page. Changing the Cache-Control header from private to public make more sense now, where we could utilized the caching ability of CDN (such as Cloudflare) to reduce server load. We found some complain about the private header from webplatform as well: https://webplatform.github.io/docs/WPD/Infrastructure/architecture/Things_to_consider_when_we_expose_service_via_Fastly_and_Varnish/ .

Is there anyway to convert Cache-Control header in pages from private to public?

Best Regards,

Event Timeline

Zoglun created this task.Mar 5 2019, 2:13 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 5 2019, 2:13 PM

Is this a bug report (if it is, what is the bug?) or a support question?

Zoglun added a comment.Mar 5 2019, 3:13 PM

Is this a bug report (if it is, what is the bug?) or a support question?

I am not sure the "private" cache header is a feature or just an ancient setting now become a bug. It either should be set to default "public", or offer a $wg setting variable to change the Cache-Control header. Either way will work better than send "private" no matter user login or not.