On Wed, Jun 8, 2011 at 1:50 PM, Robert Cummings robert@interjinn.comwrote:
I've looked around for methods to manipulate the cache duration for a given article. There are methods to facilitate the expiration of an article, and there are extensions that can disable caching for articles via convenient management interfaces. What seems to be lacking though, is a way to expire the article after some duration. For instance, I'm working with embedded RSS feeds...
[snip]
It looks like MediaWiki 1.17 and later support this already, by calling updateCacheExpiry() on the parser cache output object.
The RSS extension uses this in its rendering hook:
if ( $wgRSSCacheCompare ) { $timeout = $wgRSSCacheCompare; } else { $timeout = $wgRSSCacheAge; }
$parser->getOutput()->updateCacheExpiry( $timeout );
In theory at least this should propagate the shorter expiry time out to both the parser cache entry and the actual output page's HTTP headers, though I haven't tested to double-check myself yet.
-- brion