mediawiki-extensions-Secure.../includes/ServiceWiring.php
thiemowmde 01f3701c90 Lazy load large domains.php file only when it's really needed
I have seen this popping up once in a recent flame graph. I think most
services should be designed in a way that they can be instantiated
very quickly and only start doing expensive stuff when we are sure we
really need it. This was not the case here. The file domains.php is
about 150,000 lines long and can take several 100ms to load in the
worst case.

Bug: T200758
Change-Id: I7c0c787230e8cff40e8e73fede0ac1dce63ea1ca
(cherry picked from commit e5df1df69e)
2023-06-16 10:33:20 +00:00

12 lines
268 B
PHP

<?php
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2022 Kunal Mehta <legoktm@debian.org>
namespace MediaWiki\SecureLinkFixer;
return [
'HSTSPreloadLookup' => static function () {
return new HSTSPreloadLookup( __DIR__ . '/../domains.php' );
}
];