当前位置:网站首页>About the state transfer problem of SAP e-commerce cloud Spartacus UI SSR
About the state transfer problem of SAP e-commerce cloud Spartacus UI SSR
2022-08-04 20:04:00 【HUAWEI CLOUD】
Angular's TransferState class enables server-side rendering (SSR) and pre-rendering (SSR) Angular applications to efficiently render in the browser using data fetched from the server.
I created a storefront with Schematics based on version 3.4.5 (which a customer is using) and ran it in SSR mode.
I visit http://localhost:4000/ in my browser.
From Chrome Dev Tools I know that the source code of the home page is successfully generated by the SSR server.

However, even in SSR mode, I found that the /cms/pages OCC API is still triggered from the client.


In the log of the SSR server, I did not find the CSR fallback:

However, on the client side, I still found these OCC API calls:
Even if I use code like this:
ConfigModule.withConfig({ state: { ssrTransfer: { keys: { products: true, cms: true } } }}); Only make sure that the client is not sending product related API calls.

Answers
- For Product - I guess the status has moved from SSR to CSR.
- For cms - I guess we make the call whether we are in the ngrx store or not.What we are discussing may be improved in the future
By default, Spartacus reloads CMS page data on every route change, regardless of whether it is already maintained in ngrx state.However, customers can configure routing.loadStrategy differently via Spartacus: RouteLoadStrategy.ONCE
It is used in the CmsPageGuard.shouldReload method.
边栏推荐
猜你喜欢
随机推荐
2022年国内手机满意度榜单:华为稳坐国产品牌第一
泰山OFFICE技术讲座:底纹、高亮、边框的关系
How to manually download and install SAP Fiori tools - Extension Pack for Visual Studio Code
ASP.NET商贸进销存管理系统源码(带数据库文档)源码免费分享
really time ntp服务启动命令
二叉树的前序遍历
备忘录模式
性能测试流程
nr part calculation
awk statistical average max min
web 应用开发最佳实践之一:避免大型、复杂的布局和布局抖动
linkboy 5.0 正式发布,新增语音识别、图像识别
"WAIC 2022 · hackers marathon" two ants wealth competition invited you to fight!
手撕SparkSQL五大JOIN的底层机制
新式茶饮,卷完水果还能卷什么?
【Attention演变史】翻译模型seq2seq (第二弹)
从卖产品到卖“链路”:20条策略 解读直播带货迭代玩法
KubeSphere简介,功能介绍,优势,架构说明及应用场景
使用 Allatori 进行 Jar 包混淆
Chrome 开发者工具 performance 标签页的用法









