Try to avoid master queries for GET requests
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Wed, 16 Jan 2019 22:25:46 +0000 (23:25 +0100)
committerDaimona Eaytoy <daimona.wiki@gmail.com>
Wed, 16 Jan 2019 22:25:46 +0000 (23:25 +0100)
commit1a453971a3da1afb86b1df0ef2276c9c2c7cd717
tree1f3587de35f129e7877c59510a86705f5a2887a5
parentd773ec9dcd71bd584556fc53dda170b172ac2372
Try to avoid master queries for GET requests

Skin::getUndeleteLink performs several checks, including a
Title::userCan, which in turn checks the blocked status from master in
order to decide whether to show the link. This happens during GET
requests, and a basic calculation shows that it is responsible for
roughly 15% of the DBPerformance alerts.
This patch rearranges the IF conditions so that the permission check is
performed last, and thus will be avoided if the previous condition is
false.

Change-Id: I45a18a244a26df09beb12e198e0e91a465bd1907
includes/skins/Skin.php