Merge "Update namespace names for Sanskrit"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index 408487b..cecb6a2 100644 (file)
@@ -221,7 +221,8 @@ class ResourceLoader implements LoggerAwareInterface {
 
                                $result = self::applyFilter( $filter, $data, $this->config );
 
-                               $stats->timing( "resourceloader_cache.$filter.miss", microtime( true ) - $statStart );
+                               $statTiming = microtime( true ) - $statStart;
+                               $stats->timing( "resourceloader_cache.$filter.miss", 1000 * $statTiming );
                                if ( $options['cacheReport'] ) {
                                        $result .= "\n/* cache key: $key */";
                                }
@@ -811,7 +812,7 @@ class ResourceLoader implements LoggerAwareInterface {
                        header( 'Cache-Control: private, no-cache, must-revalidate' );
                        header( 'Pragma: no-cache' );
                } else {
-                       header( "Cache-Control: public, must-revalidate, max-age=$maxage, s-maxage=$smaxage" );
+                       header( "Cache-Control: public, max-age=$maxage, s-maxage=$smaxage" );
                        $exp = min( $maxage, $smaxage );
                        header( 'Expires: ' . wfTimestamp( TS_RFC2822, $exp + time() ) );
                }
@@ -1409,11 +1410,13 @@ MESSAGE;
         * @return string
         */
        public static function makeConfigSetScript( array $configuration ) {
-               return Xml::encodeJsCall(
-                       'mw.config.set',
-                       array( $configuration ),
-                       ResourceLoader::inDebugMode()
-               );
+               if ( ResourceLoader::inDebugMode() ) {
+                       return Xml::encodeJsCall( 'mw.config.set', array( $configuration ), true );
+               }
+
+               $config = RequestContext::getMain()->getConfig();
+               $js = Xml::encodeJsCall( 'mw.config.set', array( $configuration ), false );
+               return self::applyFilter( 'minify-js', $js, $config );
        }
 
        /**