Index: trunk/phase3/includes/Parser.php |
— | — | @@ -4040,6 +4040,7 @@ |
4041 | 4041 | * shouldn't be cached. |
4042 | 4042 | */ |
4043 | 4043 | function disableCache() { |
| 4044 | + wfDebug( "Parser output marked as uncacheable.\n" ); |
4044 | 4045 | $this->mOutput->mCacheTime = -1; |
4045 | 4046 | } |
4046 | 4047 | |
Index: trunk/phase3/includes/ParserCache.php |
— | — | @@ -97,23 +97,31 @@ |
98 | 98 | function save( $parserOutput, &$article, &$user ){ |
99 | 99 | global $wgParserCacheExpireTime; |
100 | 100 | $key = $this->getKey( $article, $user ); |
101 | | - $now = wfTimestampNow(); |
102 | | - $parserOutput->setCacheTime( $now ); |
103 | | - |
104 | | - // Save the timestamp so that we don't have to load the revision row on view |
105 | | - $parserOutput->mTimestamp = $article->getTimestamp(); |
106 | 101 | |
107 | | - $parserOutput->mText .= "\n<!-- Saved in parser cache with key $key and timestamp $now -->\n"; |
108 | | - wfDebug( "Saved in parser cache with key $key and timestamp $now\n" ); |
109 | | - |
110 | | - if( $parserOutput->containsOldMagic() ){ |
111 | | - $expire = 3600; # 1 hour |
| 102 | + if( $parserOutput->getCacheTime() != -1 ) { |
| 103 | + |
| 104 | + $now = wfTimestampNow(); |
| 105 | + $parserOutput->setCacheTime( $now ); |
| 106 | + |
| 107 | + // Save the timestamp so that we don't have to load the revision row on view |
| 108 | + $parserOutput->mTimestamp = $article->getTimestamp(); |
| 109 | + |
| 110 | + $parserOutput->mText .= "\n<!-- Saved in parser cache with key $key and timestamp $now -->\n"; |
| 111 | + wfDebug( "Saved in parser cache with key $key and timestamp $now\n" ); |
| 112 | + |
| 113 | + if( $parserOutput->containsOldMagic() ){ |
| 114 | + $expire = 3600; # 1 hour |
| 115 | + } else { |
| 116 | + $expire = $wgParserCacheExpireTime; |
| 117 | + } |
| 118 | + $this->mMemc->set( $key, $parserOutput, $expire ); |
| 119 | + |
112 | 120 | } else { |
113 | | - $expire = $wgParserCacheExpireTime; |
| 121 | + wfDebug( "Parser output was marked as uncacheable and has not been saved.\n" ); |
114 | 122 | } |
115 | | - $this->mMemc->set( $key, $parserOutput, $expire ); |
| 123 | + |
116 | 124 | } |
| 125 | + |
117 | 126 | } |
118 | 127 | |
119 | | - |
120 | 128 | ?> |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -256,6 +256,7 @@ |
257 | 257 | * Introduce NUMBEROFPAGES magic word |
258 | 258 | * (bug 5833) Introduce CURRENTVERSION magic word |
259 | 259 | * (bug 5370) Allow throttling of password reminder requests with the rate limiter |
| 260 | +* (bug 5683) Respect parser output marked as uncacheable when saving |
260 | 261 | |
261 | 262 | == Compatibility == |
262 | 263 | |