aboutsummaryrefslogtreecommitdiffstats
path: root/includes/MainConfigNames.php
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2024-10-30 15:39:10 -0400
committerC. Scott Ananian <cscott@cscott.net>2025-01-29 21:47:52 +0000
commitdf41aa3da19e5f817d1c05b7488fbe1122f7cde9 (patch)
tree16229691b802e6c9ccea7cee05c52d7ff30971a2 /includes/MainConfigNames.php
parent03db3c6abf26129bfb0ee379e6789224338f8bf0 (diff)
downloadmediawikicore-df41aa3da19e5f817d1c05b7488fbe1122f7cde9.tar.gz
mediawikicore-df41aa3da19e5f817d1c05b7488fbe1122f7cde9.zip
Add ParserOutputFlags::{HAS_ASYNC_CONTENT,ASYNC_NOT_READY}
This allows Parsoid to mark parses which contain async content which is "not ready yet". At the moment this output is cached with a reduced TTL, although in the future it might still be treated as uncacheable, cached until evicted, or some other option. The HAS_ASYNC_CONTENT flag along with ParserOutput::hasReducedExpiry() ensures that RefreshLinksJob is opportunistically reinvoked whenever the page is reparsed, since the asynchronous content may change the metadata for the page when it becomes ready. As describe in T373256, ::hasReducedExpiry() is misnamed now, and a follow-up patch will probably rename it to ::hasDynamicContent() or something like that. What it really means is "RefreshLinksJob must be re-run on every parse, because the content may change on each parse". In the past we would *also* reduce the cache time for pages like this. But for asynchronous content, "the content may change on each parse" only *until* the asynchronous content is "ready". Once it is ready the contents will no longer change, and the cache lifetime can be raised again -- but ::hasDynamicContent() still needs to be set, which in the future will mean "you need to check that RefreshLinksJob has last run" not "you must always run RefreshLinksJob". Asynchronous content will always set HAS_ASYNC_CONTENT, even after the content is "ready", but will only set ASYNC_NOT_READY if it needed to use placeholder content in this render. Bug: T373256 Change-Id: I71e10f8a9133c16ebd9120c23c965b9ff20dabd2
Diffstat (limited to 'includes/MainConfigNames.php')
-rw-r--r--includes/MainConfigNames.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/MainConfigNames.php b/includes/MainConfigNames.php
index 9a39654b7ae6..48b1a29a2d93 100644
--- a/includes/MainConfigNames.php
+++ b/includes/MainConfigNames.php
@@ -1554,6 +1554,12 @@ class MainConfigNames {
public const ParserCacheExpireTime = 'ParserCacheExpireTime';
/**
+ * Name constant for the ParserCacheAsyncExpireTime setting, for use with Config::get()
+ * @see MainConfigSchema::ParserCacheAsyncExpireTime
+ */
+ public const ParserCacheAsyncExpireTime = 'ParserCacheAsyncExpireTime';
+
+ /**
* Name constant for the OldRevisionParserCacheExpireTime setting, for use with Config::get()
* @see MainConfigSchema::OldRevisionParserCacheExpireTime
*/