Manual:$wgImagePreconnect

From mediawiki.org
Jump to navigation Jump to search
Uploads: $wgImagePreconnect
On pages containing images, tell the user agent to pre-connect to hosts from $wgForeignFileRepos.
Introduced in version:1.35.0 (git #0a3aa08b)
Removed in version:still in use
Allowed values:true or false
Default value:false
Warning Warning: EXPERIMENTAL!

Details[edit]

Adds <link rel="preconnect"> for the first valid foreign or local file repo, on pages containing images.

This is a hint to the browser that it should open a connection to the other host (e.g. upload.wikimedia.org), if it doesn't have one already. Doing so allows the connection setup to happen before page parsing is complete, and should result in faster image loading, especially on slow connections.

It may create unwanted traffic if there are many possible URLs from which images are served.