当前位置:网站首页>Differences in the working mechanism between SAP E-commerce Cloud Accelerator and Spartacus UI
Differences in the working mechanism between SAP E-commerce Cloud Accelerator and Spartacus UI
2022-08-04 19:34:00 【HUAWEI CLOUD】
单页面应用程序,又称 Single Page Application,在当今的webThe field of application development is very popular.Many businesses are interested in it,Developers want to explore it to come up with better ideas.与此同时,多年来,Multiple Page Appshave been doing well.
If you compare them based on their value and market range——它们各有利弊.那么,单页面应用程序(spa)和多页面web应用程序(mpa)哪个更好呢?
SAP Commerce Cloud Accelerator UI 基于 JSP,属于服务器端渲染技术,Commerce 服务器将渲染好的 HTML 页面发送给客户端.
当用户在当前页面点击某些元素,要跳转到新的 UI 时,这些新的 UI 和当前页面是由不同的 page 实现的.因此这些跳转操作,会触发浏览器向服务器发起新的页面请求(page request).
客户端收到服务器发送的页面响应后,刷新自己的页面:
而 Spartacus UI 是单页面应用,客户端仅仅向服务器端请求一次页面模板代码( ng build 生成的 JavaScript 代码):
至于页面要显示的业务数据,通过 OCC API 调用向服务器端索取:
最后,客户端也就是浏览器里,执行 Angular 框架代码,执行页面模板对应的 JavaScript 代码,将服务器端返回的 OCC API 响应进行渲染,得到最后客户看到的 Storefront 页面.
当然,Spartacus UI 也支持服务器端渲染模式:Server Side Render mode,简称 SSR,此时页面源代码的渲染是在 SSR 服务器上完成.OCC API 的调用,也是 SSR server 向 Commerce 服务器发起的.
更多Jerry的原创文章,尽在:“汪子熙”:
SAP Commerce Cloud Accelerator UI 基于 JSP,属于服务器端渲染技术,Commerce 服务器将渲染好的 HTML 页面发送给客户端.
当用户在当前页面点击某些元素,要跳转到新的 UI 时,这些新的 UI 和当前页面是由不同的 page 实现的.因此这些跳转操作,会触发浏览器向服务器发起新的页面请求(page request).
客户端收到服务器发送的页面响应后,刷新自己的页面:
而 Spartacus UI 是单页面应用,客户端仅仅向服务器端请求一次页面模板代码( ng build 生成的 JavaScript 代码):
至于页面要显示的业务数据,通过 OCC API 调用向服务器端索取:
最后,客户端也就是浏览器里,执行 Angular 框架代码,执行页面模板对应的 JavaScript 代码,将服务器端返回的 OCC API 响应进行渲染,得到最后客户看到的 Storefront 页面.
当然,Spartacus UI 也支持服务器端渲染模式:Server Side Render mode,简称 SSR,此时页面源代码的渲染是在 SSR 服务器上完成.OCC API 的调用,也是 SSR server 向 Commerce 服务器发起的.
边栏推荐
猜你喜欢
随机推荐
How to add custom syntax to MySQL?
seata源码解析:seata server各种消息处理流程
正畸MIA微种植体支抗技术中国10周年交流会在沈举办
Finished product upgrade program
Kubernetes之list-watch机制
SQL Server 遇到报错解决办法--更新中
「 WAIC 2022 · 黑客马拉松」蚂蚁财富两大赛题邀你来战!
[Sql brush topic] Query information data--Day1
什么是内部客户服务?
SAP UI5 确保控件 id 全局唯一的实现方法
Yuanguo chain game system development
Seata source code analysis: various message processing processes of seata server
Use "green computing" technology to promote sustainable development of computing power
awk 统计平均 最大 最小值
How to monitor code cyclomatic complexity by refactoring indicators
Embrace the Cmake child is simple and practical, but inflexible
JS: 数组和树的相互转换
Jmeter - Heap配置原因报错Invalid initial heap size: -Xms1024m -Xmx2048mError
openharmony初体验(1)
2022年7月国产数据库大事记