当前位置:网站首页>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.
边栏推荐
猜你喜欢
【TypeScript】深入学习TypeScript枚举
C#移动OA办公系统源码(基于微信企业号)
Desthiobiotin-PEG4-Azide_脱硫生物素-叠氮化物 100mg
基于Nodejs的电商管理平台的设计和实现
PriorityQueue类的使用及底层原理
LED的C语言应用程序
CAS :80750-24-9(脱硫生物素 NHS 酯)
Use "green computing" technology to promote sustainable development of computing power
KubeSphere简介,功能介绍,优势,架构说明及应用场景
How to monitor code cyclomatic complexity by refactoring indicators
随机推荐
腾讯云胡启明:Kubernetes云上资源的分析与优化
v-model的使用
MYSQL获取数据库的表名和表注释
面试官:索引为什么会失效?
简单理解 JS 事件循环
hash和history路由的区别
MYSQL gets the table name and table comment of the database
win10 uwp 修改图片质量压缩图片
seata源码解析:seata server各种消息处理流程
Chrome 开发者工具 performance 标签页的用法
使用.NET简单实现一个Redis的高性能克隆版(二)
刷题-洛谷-P1317 低洼地
二叉树的前序遍历
nr part calculation
Differences in the working mechanism between SAP E-commerce Cloud Accelerator and Spartacus UI
ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
华为WLAN技术:AP上线及相关模板的配置实验
To -.-- -..- -
成品升级程序
多用户同时远程登录连接到一台服务器