SEO Page Generator
SuiteCommerce web stores use single-page application (SPA) technology to provide a rich and responsive experience to users. When a user first visits a website that's built using an SPA, a single HTML page loads using JavaScript to build an interactive web application in the user's browser. After the SPA is built in the user's web browser, any interactions with the website take place within this application. This means reusing templates and previously loaded data, and only loading new data as needed. This boosts web performance by speeding up loading times between pages and soft navigations, since only the data needed for that page is loaded from the server.
However, many search engines, such as Google and Bing, send crawlers to websites that might not run JavaScript. This could mean that providing them with the same SPA technology that human users use could cause issues. To ensure that web stores are discoverable and indexable by search engine crawlers, an alternative approach is used.
To support search engine crawlers, server-side rendering (SSR) is used instead—this is what we call the SEO page generator. The SEO page generator is a virtual web browser that receives the crawler's requested page, executes the SPA JavaScript, and then sends the HTML content to the crawler. This means that the crawler receives prerendered pages and never has to run JavaScript.
Performance Optimizations
The SEO page generator's main value is that it serves prerendered content to users who can benefit from it, such as search engine crawlers. Prerendering content with SSR comes with a performance cost, so in some cases, the page generator won't run if it's not needed. Skipping prerendering means SSR content isn't created and loading performance improves. These optimizations include:
-
When CDN Caching is enabled, prerendered pages are stored for a short period of time so that they can be sent to other users requesting the same page. The page generator doesn't run since fresh content is already available.
-
User agent detection is used to see if the requester identifies as a web crawler or other bot. If the system is sure the user is human, the page generator won't run.
-
The page generator won't run when a user is logged in or in a recognized state. For more information, see Roles.
This applies to both public and private parts of the website, such as shopping, checkout, and My Account.
-
Some JavaScript won't load if it's not useful for crawlers. For example, the Application Performance Management (APM) for Commerce library isn't requested if the page generator is processing the page. Developers can also exclude custom resources from prerendered HTML by following the SEO Page Generator Best Practices.
-
The page generator won't run if you request a page in a local developer environment with the Commerce developer tools. For more information, see Tools Overview.
To learn more about the SEO page generator, refer to the following sections: