-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy content via public-api, even when we're on a simple site. #90895
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~166 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~1716 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~336 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
In order to solve #87642, we need to proxy any images in the media area via the public API. This solves two main cases: 1) Where the primary redirect is not yet pointed to us via DNS 2) Where a service like Cloudflare is in front of the primary redirect, and blocks "hotlinking" images These cases both used to work fine, as media was served from *.files.wordpress.com regardless of the actual domain being used. Once this was been moved to use wp-content/uploads (in order to fix issues when third party cookies are blocked), the two cases above (and probably some others we don't know about) stopped working.
The changes look simple enough that manual testing might suffice, but I personally would add a unit test for both functions to ensure that we get the right output for each permutation of values. If you're not acquainted with adding unit tests here, I can have a look tomorrow and help you to add them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: we want to proxy content for all sites, just not for non-atomic Jetpack sites?
I agree with Marcelo's feedback and left a few more suggestions.
I think most of those are minor issues though and this can be shipped after addressing our feedback.
953b384
to
2740d2c
Compare
Correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This reapplies the change from #90895 - there have been some changes to public-api.wordpress.com that resolved the problem that caused that MR to get reverted (D150124-wpcom). This change ultimately causes all links in the media library to be proxied via public-api.wordpress.com, which ensures that they are accessible even in the case of broken primary domains.
This reapplies the change from #90895 - there have been some changes to public-api.wordpress.com that resolved the problem that caused that MR to get reverted (D150124-wpcom). This change ultimately causes all links in the media library to be proxied via public-api.wordpress.com, which ensures that they are accessible even in the case of broken primary domains.
Related to #87642
Proposed Changes
In order to solve #87642, we need to proxy any images in the media area via the public API.
This solves two main cases:
These cases both used to work fine, as media was served from *.files.wordpress.com regardless of the actual domain being used. Once this was been moved to use wp-content/uploads (in order to fix issues when third party cookies are blocked), the two cases above (and probably some others we don't know about) stopped working.
This will not work until D149138-code is deployed(this has been deployed)Testing Instructions
Pre-merge Checklist