-
Notifications
You must be signed in to change notification settings - Fork 35
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
MWPW-157573 Optimize EdgeWorker for Mobile Widget #785
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #785 +/- ##
==========================================
+ Coverage 90.15% 90.18% +0.03%
==========================================
Files 43 43
Lines 5494 5512 +18
==========================================
+ Hits 4953 4971 +18
Misses 541 541 ☔ View full report in Codecov by Sentry. |
const [responseStream, responseHeaders, dcCoreVersion, mobileWidget] = await fetchFrictionlessPageAndInlineSnippet(); | ||
|
||
await Promise.all([ | ||
fetchAndInlineScripts(mobileWidget), |
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.
looks like this will hurt our performance. There are fetches in there that would otherwise be done in parallel with the first request
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.
We need to know if mobile-widget
is true or false to decide what scripts to be inline and preloads. Therefore, they have to be separated.
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.
scripts.js is loaded regardless.
loading dc-conversion-widget.js conditionally, blocked by the first Promise, will hurt Frictionless performance on production where it is used. It might be better to load it, in parallel, and not use it where you don't need it.
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.
perhaps we could break fetchAndInlineScripts into two separate methods - fetchScript and inlineScripts. Then we could still fetch the frictionlesspage and fetchscripts in parallel, and then call inlineScripts(mobileWidget)
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.
need to make fetch requests in parallel where possible
Also, if we add a conditional to generate a different result for the same url, we can no longer cache it. That would be a huge performance loss. |
onClientRequest adds device type to the cache key. Mobile, tablet, and desktop have different caches. |
mobile-widget
is true and the client device type is mobile, the DC converter widget is not required. Eliminate unnecessary preloads and embedded scripts.Resolve: MWPW-157573
Test URLs:
https://www.stage.adobe.com/acrobat/online/sign-pdf.html
https://www.stage.adobe.com/acrobat/online/pdf-editor.html