Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
This repository was archived by the owner on Jan 10, 2019. It is now read-only.

VIP Go file service and Photon JS #16

Description

@scottsweb

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions