Hello,
I've an extension which works very well when cache is disabled. If I put : $wgEnableParserCache = false; in LocalSettings, it works very well, but the performances of the website decrease.
I'd like to set this to false *only* for pages which include my extension.
In the extension, I tried $wgTitle->invalidateCache(); which make a purge, but the new generated page is stored in the cache, and I don't want.
As I don't know which page will have this extension, I can't make a ugly hack in LocalSettings if (the url contains "MyPage1" or "PageWithTheExtension" ) { $wgEnableParserCache = false; }
My extension is a form mailer. <formmailer>tags to create the fields of the form</formmailer> The form is submitted (method=post) to /index.php?title=ThePage&action=purge&randomnumber which purges and void client-side cache the extension tag check if it get some data posted. If posted then check they are valid (correct email, no missing informations...). If ok, send the mail and display "Thank you, the mail was sent" else if error displays the error (requiried field, bad format...) and the form. if go to another page of the wiki, and then go later to ThePage (short url http://.../ThePage I see the content of the last posted data (ie I see "thank you, mail sent" or "errors + the form". so I want to NEVER put in cache this page, as if I set $wgEnableParserCache = false in LocalSettings.
Any ideas ?
I believe what you want is $parser->disableCache() from within your tag implementation.
-- Jim R. Wilson (jimbojw)
On Wed, Mar 26, 2008 at 4:40 PM, Sylvain Machefert iubito@gmail.com wrote:
Hello,
I've an extension which works very well when cache is disabled. If I put : $wgEnableParserCache = false; in LocalSettings, it works very well, but the performances of the website decrease.
I'd like to set this to false *only* for pages which include my extension.
In the extension, I tried $wgTitle->invalidateCache(); which make a purge, but the new generated page is stored in the cache, and I don't want.
As I don't know which page will have this extension, I can't make a ugly hack in LocalSettings if (the url contains "MyPage1" or "PageWithTheExtension" ) { $wgEnableParserCache = false; }
My extension is a form mailer. <formmailer>tags to create the fields of the form</formmailer> The form is submitted (method=post) to /index.php?title=ThePage&action=purge&randomnumber which purges and void client-side cache the extension tag check if it get some data posted. If posted then check they are valid (correct email, no missing informations...). If ok, send the mail and display "Thank you, the mail was sent" else if error displays the error (requiried field, bad format...) and the form. if go to another page of the wiki, and then go later to ThePage (short url http://.../ThePage I see the content of the last posted data (ie I see "thank you, mail sent" or "errors + the form". so I want to NEVER put in cache this page, as if I set $wgEnableParserCache = false in LocalSettings.
Any ideas ?
-- Sylvain Machefert http://www.tousauxbalkans.net http://iubito.free.fr/blog/ _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks, it seems to work. I'll check later if it works for non logged-in user.
2008/3/26, Jim R. Wilson wilson.jim.r@gmail.com:
I believe what you want is $parser->disableCache() from within your tag implementation.
-- Jim R. Wilson (jimbojw)
On Wed, Mar 26, 2008 at 4:40 PM, Sylvain Machefert iubito@gmail.com wrote:
Hello,
I've an extension which works very well when cache is disabled. If I put : $wgEnableParserCache = false; in LocalSettings, it works very well, but the performances of the
website
decrease.
I'd like to set this to false *only* for pages which include my
extension.
In the extension, I tried $wgTitle->invalidateCache(); which make a
purge,
but the new generated page is stored in the cache, and I don't want.
As I don't know which page will have this extension, I can't make a
ugly
hack in LocalSettings if (the url contains "MyPage1" or "PageWithTheExtension" ) { $wgEnableParserCache = false; }
My extension is a form mailer. <formmailer>tags to create the fields of the form</formmailer> The form is submitted (method=post) to /index.php?title=ThePage&action=purge&randomnumber which purges and void client-side cache the extension tag check if it get some data posted. If posted then check they are valid (correct email, no missing informations...). If ok, send the mail and display "Thank you, the mail
was
sent" else if error displays the error (requiried field, bad format...)
and
the form. if go to another page of the wiki, and then go later to ThePage (short
url
http://.../ThePage I see the content of the last posted data (ie I see "thank you, mail
sent"
or "errors + the form". so I want to NEVER put in cache this page, as if I set
$wgEnableParserCache
= false in LocalSettings.
Any ideas ?
-- Sylvain Machefert http://www.tousauxbalkans.net http://iubito.free.fr/blog/
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org