Skip to content
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

[IMP] website_event_track_online: PWA adds prefetch for offline use #56058

Closed

Conversation

pparidans
Copy link
Contributor

This PR adds the prefetch of the current page's children (cf. under
the same scope) to be available for offline use.

For performance reason, only the first-level children are added to the
cache to avoid a huge amount of requests and/or resources used by simply
loading the event website's pages. Also, for the same reason, this
process is delegated to the ServiceWorker to avoid cluttering the Main
Thread.

Also, this PR perform some linting and ensure ES5 usage (for compatibility purpose).

@pparidans pparidans self-assigned this Aug 18, 2020
@C3POdoo C3POdoo added the RD research & development, internal work label Aug 18, 2020
@pparidans pparidans force-pushed the saas-13.3-event-pwa-prefetch-app branch from 2eb2530 to 37a5854 Compare August 18, 2020 13:26
@pparidans pparidans force-pushed the saas-13.3-event-pwa-prefetch-app branch from 37a5854 to c5038a3 Compare August 19, 2020 09:40
This commit adds the prefetch of the current page's children (cf. under
the same scope) to be available for offline use.

For performance reason, only the first-level children are added to the
cache to avoid a huge amount of requests and/or resources used by simply
loading the event website's pages. Also, for the same reason, this
process is delegated to the ServiceWorker to avoid cluttering the Main
Thread.

Note: due to some security restriction introduced in the Fetch spec,
some redirects may prevent offline-requests from being properly
fulfilled from the cache. See references for further details.

References:
- whatwg/fetch#763
- GoogleChromeLabs/sw-precache#220
- https://fetch.spec.whatwg.org/#concept-request-redirect-mode
@pparidans pparidans force-pushed the saas-13.3-event-pwa-prefetch-app branch from eefbb03 to 4e7e6a4 Compare August 19, 2020 13:45
@robodoo robodoo added ☐ ci/template CI 🤖 Robodoo has seen passing statuses and removed ☑ ci/template labels Aug 19, 2020
@pparidans
Copy link
Contributor Author

@adr-odoo it's green!!!! 😎

@adr-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Aug 19, 2020
This commit adds the prefetch of the current page's children (cf. under
the same scope) to be available for offline use.

For performance reason, only the first-level children are added to the
cache to avoid a huge amount of requests and/or resources used by simply
loading the event website's pages. Also, for the same reason, this
process is delegated to the ServiceWorker to avoid cluttering the Main
Thread.

Note: due to some security restriction introduced in the Fetch spec,
some redirects may prevent offline-requests from being properly
fulfilled from the cache. See references for further details.

References:
- whatwg/fetch#763
- GoogleChromeLabs/sw-precache#220
- https://fetch.spec.whatwg.org/#concept-request-redirect-mode

closes #56058

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
@robodoo robodoo closed this Aug 19, 2020
@robodoo robodoo temporarily deployed to merge August 19, 2020 14:54 Inactive
@fw-bot fw-bot deleted the saas-13.3-event-pwa-prefetch-app branch September 2, 2020 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants