Last modified: 2006-05-13 17:41:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T7683, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5683 - always in parser cache after article save
always in parser cache after article save
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.7.x
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-22 15:14 UTC by Austin Che
Modified: 2006-05-13 17:41 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
test extension (251 bytes, text/plain)
2006-04-23 02:57 UTC, Austin Che
Details
Working version (268 bytes, text/plain)
2006-04-23 03:26 UTC, Rob Church
Details

Description Austin Che 2006-04-22 15:14:24 UTC
After upgrading from version 1.5, the latest version of MediaWiki has an 
undesirable feature when saving an article. Article::editUpdates is always 
called whenever an article is saved. In editUpdates, the article is 
unconditionally saved into the parser cache. This makes it difficult for an 
extension that generates dynamic content to disable the parser cache (with 
Parser::disableCache()). A manual cache purge after article save allows an 
extension to again disable caching.
Comment 1 Brion Vibber 2006-04-22 19:20:24 UTC
It's supposed to be cached, that's normal -- and highly desirable as it
reduces the number of unnecessary repeated renderings.

Can you provide some minimal sample code for an extension that disables
caching in the manner you describe?
Comment 2 Austin Che 2006-04-23 02:57:05 UTC
Created attachment 1599 [details]
test extension
Comment 3 Austin Che 2006-04-23 03:03:19 UTC
The attachment creates a new date tag which simply displays the 
current time. If the extension is enabled, a page with the date tag 
is edited and saved, then the page is displayed with the time of 
the save. Reloading the page will not update the time (which is not 
what is desired). If the parser cache is manually purged, then 
reloads of the page will update the time as desired. I'm not saying 
that the cache is undesirable, just that it is undesirable to be 
automatic after a page save. If it isn't saved into the cache 
immediately after save, then it would be normally saved into the 
cache on the next view, thus the cost of removing this would only 
be one extra rendering. If an extension wants to disable the parser 
cache, it can catch the second rendering and not allow it to enter 
into the cache. The alternative would be to provide a way for an 
extension to not have a page be cached after save.
Comment 4 Rob Church 2006-04-23 03:26:56 UTC
Created attachment 1600 [details]
Working version

Working version, fixes two oversights:

1. Parser::disableCache() is a function, not a member
2. You need to accept a reference to the parser when the tag is rendered and
use that to disable the cache
Comment 5 Rob Church 2006-04-23 03:28:07 UTC
In light of comment 4, I'm going to resolve this WORKSFORME.
Comment 6 Austin Che 2006-04-23 16:15:38 UTC
That doesn't fix the problem. You are correct the disableCache was messed up (and I 
didn't notice it because I was disabling the cache via something else on my test page) 
but that isn't the problem. Also, using the global $wgParser or the passed in parser 
variable doesn't change anything. In fact, comparing the two values, they are identical. 
If you think it fixes the problem, then please explain why you think the page using this 
extension would not be cached on a page save. disableCache() only sets a variable that 
is never checked on page save.
Comment 7 Rob Church 2006-04-23 17:03:29 UTC
On closer inspection, you're correct; clearly the system I used to test my
version of the extension had something disabled elsewhere. I've tracked down
what I think the problem is, but I don't plan on committing the patch without
having it reviewed first, since a problem with the parser cache would cause the
Wikimedia cluster to fall over in short order.
Comment 8 Ross M 2006-05-12 05:25:47 UTC
Hi all,

I've posted a workaround hack for this bug on Meta:
http://meta.wikimedia.org/wiki/Enforcing_DisableCache

I'd appreciate feedback, particularly if it turns out to not work as it should.

Thanks, Algorithm
Comment 9 Rob Church 2006-05-13 17:41:14 UTC
Should now be fixed in SVN trunk, r14201.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links