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

[Issue] Use pre-render to boost Largest Contentful Paint (LCP) #3107

Open
m2-assistant bot opened this issue Apr 7, 2021 · 2 comments
Open

[Issue] Use pre-render to boost Largest Contentful Paint (LCP) #3107

m2-assistant bot opened this issue Apr 7, 2021 · 2 comments

Comments

@m2-assistant
Copy link

m2-assistant bot commented Apr 7, 2021

This issue is automatically created based on existing pull request: #3090: Use pre-render to boost Larget Contentful Paint (LCP)


Description

This will add hydrate option when root element has children. This is a follow-up for requested default Rendertron Middleware support in #3058

This PR depends on this Rendertron PR GoogleChrome/rendertron#654
Which allows to keep javascript tags so you can use rehydrate the page.

Acceptance

Verification Stakeholders

Specification

Verification Steps

  1. Spin up Rendertron based on this PR [FEATURE] Allow setting specific javascriptQuerySelectors so you coul… GoogleChrome/rendertron#654 and run it with the following config.json
{
  "cache": "filesystem",
  "cacheConfig": {
    "cacheDurationMinutes": 120,
    "cacheMaxEntries": 50,
    "snapshotDir": "~/tools/rendertron/snapshots"
  },
  "stripSelectors": "",
  "port": "3000",
  "closeBrowser": true
}
  1. Add the following lines to your .env
RENDERTRON_URL=https://localhost:3000/render
RENDERTRON_USER_AGENTS="^((?!HeadlessChrome).)*$"
RENDERTRON_EXCLUDE_URL_PATTERN="graphql|\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|svg|eot)"
  1. When you now visit the page you get a pre-render response which can be re-hydrated.
  2. The config is set to use a cache layer so now you can use SEOSnap to use as a CacheWarmer
  3. When rendertron is not running it will automatically fallback to the default render functionality

Screenshots / Screen Captures

Pre-rendered

image

Not Pre-rendered

image

@sirugh
Copy link
Contributor

sirugh commented Apr 7, 2021

@magento export issue to JIRA project PWA as Story

@github-jira-sync-bot
Copy link

✅ Jira issue (https://jira.corp.magento.com/browse/PWA-1659) is successfully created for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants