X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FCategoryPage.php;h=ccc50f78ddb3e3bfa3be9ec3c633fdadd79f5644;hb=6f19bac69546b8a5cc06f91a81e364bf905dee7f;hp=865471c33dc6b62812366b545633f1b1fcd908ab;hpb=3d653e8ab542e502f4dcf574c9e4917cf56a5f8c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/CategoryPage.php b/includes/page/CategoryPage.php index 865471c33d..ccc50f78dd 100644 --- a/includes/page/CategoryPage.php +++ b/includes/page/CategoryPage.php @@ -54,7 +54,10 @@ class CategoryPage extends Article { return; } - if ( !Hooks::run( 'CategoryPageView', [ &$this ] ) ) { + // Avoid PHP 7.1 warning of passing $this by reference + $categoryPage = $this; + + if ( !Hooks::run( 'CategoryPageView', [ &$categoryPage ] ) ) { return; } @@ -68,6 +71,10 @@ class CategoryPage extends Article { if ( $title->inNamespace( NS_CATEGORY ) ) { $this->closeShowCategory(); } + + # Use adaptive TTLs for CDN so delayed/failed purges are noticed less often + $outputPage = $this->getContext()->getOutput(); + $outputPage->adaptCdnTTL( $this->mPage->getTouched(), IExpiringStore::TTL_MINUTE ); } function openShowCategory() {