http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72794

Revision: 72794
Author:   nikerabbit
Date:     2010-09-11 10:06:45 +0000 (Sat, 11 Sep 2010)

Log Message:
-----------
Another approach for caching

Modified Paths:
--------------
    trunk/extensions/Translate/SpecialTranslationStats.php

Modified: trunk/extensions/Translate/SpecialTranslationStats.php
===================================================================
--- trunk/extensions/Translate/SpecialTranslationStats.php      2010-09-11 
10:02:08 UTC (rev 72793)
+++ trunk/extensions/Translate/SpecialTranslationStats.php      2010-09-11 
10:06:45 UTC (rev 72794)
@@ -82,25 +82,21 @@
                if ( $this->including() ) {
                        $wgOut->addHTML( $this->image( $opts ) );
                } elseif ( $opts['graphit'] ) {
-                       // Cache for two hours
-                       if ( !$opts['preview'] ) {
-                               $lastMod = $wgOut->checkLastModified( 
wfTimestamp( TS_MW, time() - 2 * 3600 ) );
 
-                               if ( $lastMod ) {
-                                       return;
-                               }
-                       }
-
-                       if ( !$wgRequest->getBool( 'debug' ) ) {
-                               $wgOut->disable();
-                       }
-
                        if ( !class_exists( 'PHPlot' ) ) {
                                header( "HTTP/1.0 500 Multi fail" );
                                echo "PHPlot not found";
                        }
 
                        $this->draw( $opts );
+
+                       if ( !$wgRequest->getBool( 'debug' ) ) {
+                               $wgOut->disable();
+                               header( 'Content-Type: image/png' );
+                               header( 'Cache-Control: private, max-age=3600' 
);
+                               header( 'Expires: ' . wfTimestamp( TS_RFC2822, 
time() + 3600 ) );
+                       }
+
                } else {
                        $this->form( $opts );
                }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to