-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature/3246 static pages #3256
Conversation
This is awesome! |
done! @patzick and @filrak please do a review and merge; it's an experimental feature for now but as I've tested it works pretty OK. Initially, I wanted to integrate it with the SSR cache (in order to invalidate the static pages as the products and categories got changed); but as for now, I think we'll wait for the response from the users if this feature does have any real-world application :) |
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.
This feature is prty amazing! :)
Can you briefly explain which parts in server js are specific to this static rendering mechanism? For the sake of modualrity it would be good to know this
I moved everything out to helpers so no code duplicates with core server |
So if I understand this feature request correctly it allows for static page generation, which can then be hosted on netlify etc. so no node server is necessary any more? But the API will still need to be hosted somewhere? |
@agcty yeah, exactly as you wrote! API still needs to be hosted somewhere on node.js |
Related issues
closes #3246
I've added a static page generator that will be combined with the SSR output cache at some point. The POC is a separate CLI tool that generates the static HTML files for all the products and categories one have in Elastic.
Short description and why it's useful
The whole
static/
folder can be deployed to any static file hosting of one's wish - including Netlify, S3, and other providers. The load time for SSR requests will be extremely low (low 2-3ms).Note: The API however still will be needed for the CSR requests + dynamic requests (like shopping cart updates).
Screenshots of visual changes before/after (if there are any)
TODO:
page
/size
parameters supported for generating the page structureentityType
parameter (product
,category
,cmsPage
) supportcore/server.js