Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.php |
— | — | @@ -41,4 +41,8 @@ |
42 | 42 | 'template' => 'Lp-wrapper', |
43 | 43 | 'appeal' => 'Appeal-default', |
44 | 44 | 'form' => 'Form-default' |
45 | | -); |
\ No newline at end of file |
| 45 | +); |
| 46 | + |
| 47 | +// Adding configurrable variable for caching time |
| 48 | +$wgFundraiserLandingPageMaxAge = 300; //5 minutes |
| 49 | + |
Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php |
— | — | @@ -12,10 +12,11 @@ |
13 | 13 | } |
14 | 14 | |
15 | 15 | function execute( $par ) { |
16 | | - global $wgFundraiserLPDefaults; |
17 | | - |
| 16 | + global $wgFundraiserLPDefaults, $wgOut, $wgFundraiserLandingPageMaxAge; |
| 17 | + |
| 18 | + #Set squid age |
| 19 | + $wgOut->setSquidMaxage($wgFundraiserLandingPageMaxAge); |
18 | 20 | $request = $this->getRequest(); |
19 | | - $this->setHeaders(); |
20 | 21 | |
21 | 22 | # clear output variable to be safe |
22 | 23 | $output = ''; |
— | — | @@ -47,6 +48,7 @@ |
48 | 49 | $this->getOutput()->addWikiText( $output ); |
49 | 50 | } |
50 | 51 | |
| 52 | + |
51 | 53 | /** |
52 | 54 | * This function limits the possible charactes passed as template keys and |
53 | 55 | * values to letters, numbers, hypens and underscores. The function also |
— | — | @@ -64,4 +66,5 @@ |
65 | 67 | } |
66 | 68 | return ''; |
67 | 69 | } |
68 | | -} |
\ No newline at end of file |
| 70 | +} |
| 71 | + |