当前位置:网站首页>SAP e-commerce cloud Spartacus SSR Optimization Engine execution sequence of several timeouts
SAP e-commerce cloud Spartacus SSR Optimization Engine execution sequence of several timeouts
2022-07-31 12:44:00 【HUAWEI CLOUD】
SSR optimization engine option 代码:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 9000, concurrency: 1, forcedSsrTimeout:90000, maxRenderTime:1000, cache: true, cacheSize: 10, renderingStrategyResolver: (req) => RenderingStrategy.DEFAULT});(1) 首先是 MaxRenderTimeout 超时到达:
显示 log:
然后是:


最后:
注意,这里的 log 不会打印到控制台上:
这两个 timeout 值,谁的数值大,则谁对应的 timeout callback 就会后执行.
以 CmsSetPageSuccessIndex 为例:

运行时该 Action 类包含三大字段:
(1) meta
(2) payload
(3) type
meta
meta 包含的 loader 字段和 meta 本身都是一个 object.
meta.entityId 和 entityType 是该 action payload 的标识位.

loader 表明该 entity 加载状况.
payload
包含的业务数据:

type
字符串类型.
从 上图 Prototype 能看出,CmsSetPageSuccessIndex 的原型链类为 EntitySuccessAction.
这一点也能从其实现代码看出:
export class CmsSetPageSuccessIndex extends StateUtils.EntitySuccessAction { readonly type = CMS_SET_PAGE_SUCCESS_INDEX; constructor(pageContext: PageContext, payload: Page) { super(pageContext.type, pageContext.id, payload); }}查看 EntitySuccessAction 的实现:

属性1,meta 属性,定义在该类里.
属性2,payload,通过构造函数参数定义.
属性3,type,定义在上图81行,然后被 CmsSetPageSuccessIndex 重载.
EntitySuccessAction 构造函数接收三个参数:entityType,id 和 payload.
通过 entityType 和 id,生产出 meta 字段.
entitySuccessMeta 可以看成一个构造器或者工厂函数:
根据 entityType 和 id,生产出 EntityLoaderMeta, 后者是 EntityMeta 和 LoaderMeta 的联合.
export interface EntityMeta { entityType: string; entityId: string | string[]; entityRemove?: boolean;}export interface LoaderMeta { entityType: string; loader: { load?: boolean; error?: any; success?: boolean; };}采用三个点的语法,是因为这两个 interface,都有同名字段:entityType
LoaderMeta 的运行时数据,通过构造器 loadMeta 制造:
export function loadMeta(entityType: string): LoaderMeta { return { entityType: entityType, loader: { load: true, }, };}EntityMeta 字段的值,通过 entityMeta 构造:
export function entityMeta(type: string, id: string | string[]): EntityMeta { return { entityType: type, entityId: id, };}运行时通过 PageEffect 从 Commerce Cloud 后台读取 CMS 数据成功后,新建 ActionClass,将负载通过构造函数参数传入.

边栏推荐
- 纷享销客罗旭对话元气森林黄晓枫:零售数字化的终点不是创新,而是数据
- 基本语法(二)
- 关于我放弃考研这件事儿
- SAP 电商云 Spartacus UI 和 Accelerator UI 里的 ASM 模块
- 0x80070570 The file or directory is damaged and cannot be deleted (how to delete 0x80070091)
- PAT考试总结(考试心得)
- 五种数据提交方式的优化
- How does the SAP ABAP OData service support the $filter (filter) operation trial version
- Wearing detection and action recognition of protective gear based on pose estimation
- Google Chrome(谷歌浏览器)安装使用
猜你喜欢

机器学习基本概念

Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法

线性表的基本概念

深度学习基本概念

365天挑战LeetCode1000题——Day 044 最大层内元素和 层次遍历
![[CPU Design Practice] Simple Pipeline CPU Design](/img/83/e1dfedfe2b2cfe83a34f86e252caa7.jpg)
[CPU Design Practice] Simple Pipeline CPU Design

PyQt5 rapid development and actual combat 10.1 Get city weather forecast

串的基本概念与操作

PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks

PyQt5 rapid development and actual combat 9.7 Automated testing of UI layer
随机推荐
CentOS7 installation MySQL graphic detailed tutorial
docker部署完mysql无法连接
log4j2的使用
查看Oracle数据库的用户名和密码
函数的参数
[CPU Design Practice] Simple Pipeline CPU Design
Acwing第 62 场周赛【未完结】
基于生物激励神经网络的室内实时激光SLAM控制方法
线性表的基本概念
Using SQL Server FOR XML and FOR JSON syntax on other RDBMSs with jOOQ
NameNode (NN) 和SecondaryNameNode (2NN)工作机制
FastAPI 封装一个通用的response
机器学习基本概念
基本语法(二)
sqlalchemy determines whether a field of type array has at least one consistent data with an array
尚硅谷–MySQL–基础篇(P1~P95)
How does the SAP ABAP OData service support the $filter (filter) operation trial version
PyQt5 rapid development and actual combat 9.7 Automated testing of UI layer
手撕Verilog PWM呼吸灯
亲测可用!!!WPF中遍历整个窗口的所有TextBox组件,对每个输入框做非空判断。