vip-go-mu-plugins icon indicating copy to clipboard operation
vip-go-mu-plugins copied to clipboard

Force all VIP sites to use local domain for Photon

Open mjangda opened this issue 6 years ago • 5 comments
trafficstars

The VIP File Service has Photon capabilities, but is served from the same domain. If the Photon module is enabled, force Jetpack to use the files service instead of the default Photon domains (i*.wp.com) for internal files.

Externally hosted files continue to use the remote Photon service.

Previously, this was only enabled if you had the WPCOM_VIP_USE_JETPACK_PHOTON constant enabled. This enables it for all since we want this behaviour everywhere. We also don't need to wait until #1012 is deployed.

Fixes #1274

Checklist

Please make sure the items below have been covered before requesting a review:

  • [ ] This change works and has been tested locally (or has an appropriate fallback).
  • [ ] This change works and has been tested on a Go sandbox.
  • n/a This change has relevant unit tests (if applicable).
  • [ ] This change has relevant documentation additions / updates (if applicable).

Steps to Test

  1. Check out PR.
  2. Enable Photon module (wp jetpack module enable photon)
  3. Ensure WPCOM_VIP_USE_JETPACK_PHOTON constant isn't set.
  4. Load a post with a local image and an externally hosted image.
  5. Verify that the local image is loaded from the site itself and external image from the i*.wp.com domain.

Then, enable the WPCOM_VIP_USE_JETPACK_PHOTON constant and verify that the behaviour doesn't change.

Then, retest with the Photon module disabled and verify that all images load from their respective domains.

mjangda avatar Jun 06 '19 22:06 mjangda

@mjangda - does it get confusing that A8c_Files::use_jetpack_photon() can return true but the image domain is still the site's domain (not i*.wp.com)?

nickdaugherty avatar Jul 02 '19 22:07 nickdaugherty

Hi @mjangda / @nickdaugherty .

Is this still a wanted change?

If so could you please point me to a good direction on how to test this? I tried on my vip go site to setup post with a local image and remote image - https://pschoffer-develop.go-vip.net/2021/08/09/testing-photon/. None of them are sourced from i*.wp.com with or without this change.

But, I guess I am missing a key understanding of what the photon service is :) I did look up that it is part of JP accelerator, but I failed to find the switch to enable it as described in the linked doc.

This is how my JP settings page looks like: image

pschoffer avatar Aug 09 '21 13:08 pschoffer

CC @itsTallulah, thought you might have thoughts here :)

WPprodigy avatar Dec 09 '21 20:12 WPprodigy

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 08 '22 17:09 sonarqubecloud[bot]

Codecov Report

Merging #1276 (22a34b1) into develop (2c5d9e7) will not change coverage. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             develop    #1276   +/-   ##
==========================================
  Coverage      34.19%   34.19%           
  Complexity      3554     3554           
==========================================
  Files            215      215           
  Lines          13755    13755           
==========================================
  Hits            4703     4703           
  Misses          9052     9052           
Impacted Files Coverage Δ
a8c-files.php 18.40% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 08 '22 17:09 codecov[bot]

This pull request has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep pull requests manageable and actionable and is not a comment on the quality of this pull request nor on the work done so far. Closed PRs are still valuable to the project and their branches are preserved.

github-actions[bot] avatar Nov 08 '22 00:11 github-actions[bot]

This pull request has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep pull requests manageable and actionable and is not a comment on the quality of this pull request nor on the work done so far. Closed PRs are still valuable to the project and their branches are preserved.

github-actions[bot] avatar Jan 29 '23 00:01 github-actions[bot]