Last modified: 2010-05-15 15:54:54 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 T15776, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13776 - Images which are too small too need thumbnailing are repeatedly purged from Squid
Images which are too small too need thumbnailing are repeatedly purged from S...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-17 17:08 UTC by Tom Hughes
Modified: 2010-05-15 15:54 UTC (History)
1 user (show)

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


Attachments
Patch to stop repeated thumbnail image invalidations (3.17 KB, patch)
2008-04-17 17:09 UTC, Tom Hughes
Details

Description Tom Hughes 2008-04-17 17:08:30 UTC
If an image is too small to need thumbnailing then every reference to it in a page causes an attempt to invalidate the (non-existent) thumbnail from any Squid caches.

The problem is that transform() in filerepo/File.php calculate the filename and URL of the thumbnail image then, if the file does not exist it calls the handler's doTransform() method to create the thumbnail. Once that returns the ThmbnailImage object it asks the squid caches to invalidate the thumbnail URL.

That breaks if doTransform() decides that the image doesn't really need thumbnailing due to it's size as it then returns a ThumbnailImage object that refers to the original file, but transform() still invalidates the thumbnail URL even though no thumbnail was created.

Because no thumbnail was created, next time the image is required we go round the whole loop again.

If as I did you have a page with hundreds or thousands of instances of a small image then every single one of those causes an attempted cache invalidation. Due to a second problem with the Squid cache invalidation logic (reported separately) each one takes about 8 seconds which causes the whole page to take many minutes or even hours to render.

My current fix (patch attached) pushes down the Squid cache invalidation into the doTransform() method so that it is only done is a new thumbnail is really created.
Comment 1 Tom Hughes 2008-04-17 17:09:09 UTC
Created attachment 4826 [details]
Patch to stop repeated thumbnail image invalidations
Comment 2 Aaron Schulz 2008-05-02 19:41:40 UTC
I'd really like it if the purge could still be kept in File.php
Comment 3 Aaron Schulz 2008-05-02 21:29:37 UTC
Fixed in r34137.

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


Navigation
Links