Index: trunk/phase3/includes/ResourceLoaderModule.php |
— | — | @@ -454,19 +454,20 @@ |
455 | 455 | $this->loaders, |
456 | 456 | $this->getFileDependencies( $context->getSkin() ) |
457 | 457 | ); |
458 | | - |
459 | 458 | $filesMtime = max( array_map( 'filemtime', array_map( array( __CLASS__, 'remapFilename' ), $files ) ) ); |
460 | | - |
461 | | - // Get the mtime of the message blob |
462 | | - // TODO: This timestamp is queried a lot and queried separately for each module. Maybe it should be put in memcached? |
463 | | - $dbr = wfGetDb( DB_SLAVE ); |
464 | | - $msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array( |
465 | | - 'mr_resource' => $this->getName(), |
466 | | - 'mr_lang' => $context->getLanguage() |
467 | | - ), __METHOD__ |
468 | | - ); |
469 | | - $msgBlobMtime = $msgBlobMtime ? wfTimestamp( TS_UNIX, $msgBlobMtime ) : 0; |
470 | | - |
| 459 | + // Only get the message timestamp if there are messages in the module |
| 460 | + $msgBlobMtime = 0; |
| 461 | + if ( count( $this->messages ) ) { |
| 462 | + // Get the mtime of the message blob |
| 463 | + // TODO: This timestamp is queried a lot and queried separately for each module. Maybe it should be put in memcached? |
| 464 | + $dbr = wfGetDb( DB_SLAVE ); |
| 465 | + $msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array( |
| 466 | + 'mr_resource' => $this->getName(), |
| 467 | + 'mr_lang' => $context->getLanguage() |
| 468 | + ), __METHOD__ |
| 469 | + ); |
| 470 | + $msgBlobMtime = $msgBlobMtime ? wfTimestamp( TS_UNIX, $msgBlobMtime ) : 0; |
| 471 | + } |
471 | 472 | $this->modifiedTime[$context->getHash()] = max( $filesMtime, $msgBlobMtime ); |
472 | 473 | return $this->modifiedTime[$context->getHash()]; |
473 | 474 | } |