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

Optimize bespoke template for bfcache #323

Merged
merged 6 commits into from
Feb 14, 2021
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Feb 13, 2021

Back/forward cache (a.k.a bfcache) is the browser optimization for enabling instant back and forward navigation. Firefox and Safari have enabled while a long time, and recently it has added to Chrome for mobile.

Marp CLI's bespoke template has disabled bfcache by adding unload event. So I refactored some bespoke plugins to use new Page Lifecycle API. A notable change is in sync plugin: Persist sync key between navigation, through history state instead of URL query parameter.

By this change, the slide HTML can get a 100% Lighthouse Best Practice score.

@yhatt yhatt merged commit 1ffcdf5 into main Feb 14, 2021
@yhatt yhatt deleted the optimize-bespoke-for-bfcache branch February 14, 2021 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant