Mark ParserOptions suppressSectionEditLinks as safe to cache
commit06f683b983e5d5dcf5d8e98055caf525c5ef7838
authorC. Scott Ananian <cscott@cscott.net>
Fri, 5 Apr 2024 17:25:28 +0000 (5 13:25 -0400)
committerC. Scott Ananian <cananian@wikimedia.org>
Thu, 25 Apr 2024 14:12:40 +0000 (25 14:12 +0000)
tree09d1a0fb338d624368ed7857ab0b020def2cec4a
parent0f2d0d7bbb9abd9bb8efa7f15c4a9acc7cea66a0
Mark ParserOptions suppressSectionEditLinks as safe to cache

This will split the cache for now, but pages are generally either
always rendered with suppressed edit links or always rendered without
suppressed edit links.  Previously, ParserCache would report the page
as "not safe to cache" and always bypass the cache when
suppressSectionEditLinks was set.  This isn't a problem since no one
uses this parser option yet in production, although the original
motivation was to replace the mutation of the $options array
done by the Translate extension in the ParserOutputPostCacheTransform
hook here:
  https://gerrit.wikimedia.org/g/mediawiki/extensions/Translate/+/5eff51db8831f6abced92173821445d43f03d724/src/PageTranslation/Hooks.php#197

See 770d2bf0403e3938ad40b6294997cf55bee4f4cf for more information.

Change-Id: I88e33248c1e40a8aa694974b2a1f94e36d8c7ed6
includes/parser/ParserOptions.php
tests/phpunit/includes/parser/ParserOptionsTest.php