From 89f0d3b3d7c6a390c30abade5356cc365492410e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 20 Feb 2004 18:37:55 +0000 Subject: [PATCH] Purging of scaled images when thumbnail is regenerated. Depends on visiting the page containing the scaled image once without caching, which means it is automatic for users with session. If anon user comes first he needs to shift-reload to purge the image. --- includes/Skin.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index ca7bc7e7f9..cdf16ef493 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1528,14 +1528,23 @@ class Skin { global $wgUploadDirectory; global $wgImageMagickConvertCommand; global $wgUseImageMagick; + global $wgUseSquid, $wgInternalServer; $imgPath = wfImagePath( $name ); $thumbName = $width."px-".$icon.$name; $thumbPath = wfImageThumbDir( $thumbName )."/".$thumbName; $thumbUrl = wfImageThumbUrl( $thumbName ); if ( (! file_exists( $thumbPath ) && file_exists( $imgPath )) - || ( filemtime($thumbPath) < filemtime($imgPath) ) ) { - if ( $wgUseImageMagick ) { + || ( filemtime($thumbPath) < filemtime($imgPath) ) ) { + # Squid purging + if ( $wgUseSquid ) { + $urlArr = Array( + $wgInternalServer.$thumbUrl + ); + wfPurgeSquidServers($urlArr); + } + + if ( $wgUseImageMagick ) { # use ImageMagick $cmd = $wgImageMagickConvertCommand . " -quality 85 -geometry {$width} ". -- 2.20.1