Accept 'utf8' flag in place of 'utf-8' to compensate for entries broken by bug 16841...
[lhc/web/wiklou.git] / index.php
index 22e74e9..1c24f5a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -75,19 +75,20 @@ if( $wgUseAjax && $action == 'ajax' ) {
 
 if( $wgUseFileCache && isset($wgTitle) ) {
        wfProfileIn( 'main-try-filecache' );
-       if( HTMLFileCache::useFileCache() ) {
+       // Raw pages should handle cache control on their own,
+       // even when using file cache. This reduces hits from clients.
+       if( $action != 'raw' && HTMLFileCache::useFileCache() ) {
                /* Try low-level file cache hit */
-               $cache = new HTMLFileCache( $wgTitle );
+               $cache = new HTMLFileCache( $wgTitle, $action );
                if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
                        /* Check incoming headers to see if client has this cached */
                        if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) {
                                $cache->loadFromFileCache();
-                               # Do any stats increment/watchlist stuff
-                               $wgArticle = self::articleFromTitle( $wgTitle );
-                               $wgArticle->viewUpdates();
                        }
+                       # Do any stats increment/watchlist stuff
+                       $wgArticle = MediaWiki::articleFromTitle( $wgTitle );
+                       $wgArticle->viewUpdates();
                        # Tell $wgOut that output is taken care of
-                       $wgOut->disable();
                        wfProfileOut( 'main-try-filecache' );
                        $mediaWiki->restInPeace();
                        exit;