You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we are using Photon hooks to re-write images to use the VIP Go file service (https://github.com/Automattic/vip-jetpack/blob/master/jetpack-misc.php#L22). The hope was the Photon JavaScript for detecting device resolution and scale would continue to work and provide the correct image query parameters. Unfortunately the JS has a number of checks that fail.
The two Photon JS files used for modifying images are:
Our solution to this should be to completely disable Photon and to re-write devicepx-jetpack.js to correctly support the VIP Go file service. This may require us to pass in the current URL into the JavaScript (via variable in the head or a data-attribute) to ensure we are only modifying images served from the current site domain.
Whilst the VIP Go file service only supports one single query parameter we may also be able to prioritise the order in which the query parameters are added to ensure we are giving the best image we can. In future we will be able support multiple query parameters.
Right now we are using Photon hooks to re-write images to use the VIP Go file service (https://github.com/Automattic/vip-jetpack/blob/master/jetpack-misc.php#L22). The hope was the Photon JavaScript for detecting device resolution and scale would continue to work and provide the correct image query parameters. Unfortunately the JS has a number of checks that fail.
The two Photon JS files used for modifying images are:
https://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201607 (which contains a number of URL checks e.g.
img.src.match(/^https?:\/\/([^\/]+)\.files\.wordpress\.com\/.+[?&][wh]=/)).and
https://tumbleweed.simonwheatley.co.uk/wp-content/mu-plugins/jetpack/modules/photon/photon.js?m=1432675342g (which may be completely unnecessary).
Our solution to this should be to completely disable Photon and to re-write devicepx-jetpack.js to correctly support the VIP Go file service. This may require us to pass in the current URL into the JavaScript (via variable in the head or a data-attribute) to ensure we are only modifying images served from the current site domain.
Whilst the VIP Go file service only supports one single query parameter we may also be able to prioritise the order in which the query parameters are added to ensure we are giving the best image we can. In future we will be able support multiple query parameters.