resourceloader: Avoid isKnownEmpty call for regular (non-embed) modules
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 14 Aug 2019 12:18:50 +0000 (14:18 +0200)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 20 Aug 2019 21:11:06 +0000 (21:11 +0000)
commit3d9632a5cdfe896e6781955b341e7814abf2f760
tree8697fdbe4909ae9aa880765e632704195068e806
parent1a6e33ea614aebbd5f8530390fb4522cfd3c3ea4
resourceloader: Avoid isKnownEmpty call for regular (non-embed) modules

Modules that are never embedded, and not user-specific, should not be
excluded from the loader, even if they are empty.

Doing so has two problems:

1. Modules are expected to have their changes propagated within 5 minutes
   through the startup module. This depends on the fact that in page view
   HTML we queue the module by name, regardless of its current version.

   If the module is known to be needed by a page, then we need to queue it,
   even if the current version is empty. Otherwise, cached pages will be
   missing the module, despite the older ParserOutput perfectly knowing
   already that it was needed, which can cause bugs due to HTML not
   matching the module queue it was generated with.

2. The isKnownEmpty method can sometimes require a database lookup.
   The performance team tuned this with a preloader for the subset of
   modules we need the information for (user modules and style modules).
   In 0b1a7d4c59c8395, I accidentally made the conditions nested the wrong
   way, which made it call this much more frequently.

Bug: T230260
Bug: T176159
Change-Id: I4e6af2c833c92e1277713bdd0c68953d49c4dd9d
includes/resourceloader/ResourceLoaderClientHtml.php