From: Gabriel Wicke Date: Fri, 20 Feb 2004 18:37:55 +0000 (+0000) Subject: Purging of scaled images when thumbnail is regenerated. Depends on visiting the page... X-Git-Tag: 1.3.0beta1~971 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=89f0d3b3d7c6a390c30abade5356cc365492410e;p=lhc%2Fweb%2Fwiklou.git 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. --- 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} ".