Manual:$wgImageHtmlCacheExpiry/en

Details
Set to a number of seconds to cache the HTML associated with an image. This is an emergency optimization feature and will cause lots of problems. It is recommended that the expiry be very short and that the users be warned.

This setting seems to have only been available in version 1.4.0.