mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-09-23 10:23:03 +00:00
Merge "PdfHandler: Set cache with clearer key group and finite expiry"
This commit is contained in:
commit
df0a020174
|
@ -395,8 +395,8 @@ class PdfHandler extends ImageHandler {
|
|||
if ( !$info ) {
|
||||
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
|
||||
$info = $cache->getWithSetCallback(
|
||||
$cache->makeKey( 'file-pdf', 'dimensions', $file->getSha1() ),
|
||||
$cache::TTL_INDEFINITE,
|
||||
$cache->makeKey( 'file-pdf-dimensions', $file->getSha1() ),
|
||||
$cache::TTL_MONTH,
|
||||
static function () use ( $file ) {
|
||||
$data = $file->getMetadataItems( PdfImage::ITEMS_FOR_PAGE_SIZE );
|
||||
if ( !$data || !isset( $data['Pages'] ) ) {
|
||||
|
|
Loading…
Reference in a new issue