5 function getKey( &$article, &$user ) {
7 $hash = $user->getPageRenderingHash();
8 $pageid = intval( $article->getID() );
9 $key = "$wgDBname:pcache:idhash:$pageid-$hash";
13 function get( &$article, &$user ) {
15 $hash = $user->getPageRenderingHash();
16 $pageid = intval( $article->getID() );
17 $key = $this->getKey( $article, $user );
18 $value = $wgMemc->get( $key );
20 # Delete if article has changed since the cache was made
21 if ( $value->getTouched() != $article->getTouched() ) {
22 $wgMemc->delete( $key );
31 function save( $parserOutput, &$article, &$user ){
33 $key = $this->getKey( $article, $user );
34 $parserOutput->setTouched( $article->getTouched() );
35 if( $parserOutput->containsOldMagic() ){
36 $expire = 3600; # 1 hour
38 $expire = 7*86400; # 7 days
41 $wgMemc->set( $key, $parserOutput, $expire );