SAP Spartacus SSR学习笔记 - 如何启用SAP Spartacus服务器端渲染模式

简介: SAP Spartacus SSR学习笔记 - 如何启用SAP Spartacus服务器端渲染模式

https://sap.github.io/spartacus-docs/server-side-rendering-in-spartacus/


In Spartacus, server-side rendering allows you to render static versions of pages on the server side. This speeds up response times, assists with SEO, and allows the application to render more quickly. After Angular has bootstrapped, users of your site will have the full experience.


服务器端渲染页面的静态版本。服务器端渲染(Server Side Rendering,SSR)加快了应用的响应速度,有助于页面SEO-搜索引擎优化。


如何启用Spartacus SSR

The recommended way to add SSR support to your Spartacus application is to use schematics. With a single command, all required files are added automatically, and all modifications for SSR support are done automatically as well. To add SSR support to your Spartacus application, run the following command:


ng add @spartacus/schematics --ssr

1

Installation Steps for Spartacus Development

设置environment.prod.ts里的occBaseUrl:

image.png

关掉PWA:


As soon as Spartacus is installed in PWA mode, a service worker is installed, and it serves a cached version of index.html, along with the js files. This results in SSR being completely skipped. The following steps describe how to turn off PWA.


app.module.ts里,关闭pwa:

image.pngimage.pngimage.png

Compiling TypeScript sources through ngc


Bundling to FESM2015


Spartacus/core built完毕

Angular package built完毕


built输出位于projects/core和dist/core文件夹下面:

image.pngimage.pngimage.pngimage.png

然后:Build your local Spartacus shell app by running the following command:


yarn build --prod

1

实际上执行的命令是:


ng build storefrontapp --prod --prod

image.pngimage.pngimage.pngimage.pngimage.png

目录
相关文章
|
5月前
|
缓存 网络协议 Linux
Linux C/C++ 开发(学习笔记十三):百万并发的服务器实现
Linux C/C++ 开发(学习笔记十三):百万并发的服务器实现
96 0
|
5月前
|
存储 供应链 前端开发
Spartacus home page 渲染时,就会读取 carousel 里的 product 数据
Spartacus home page 渲染时,就会读取 carousel 里的 product 数据
|
5月前
|
存储 前端开发 Linux
在 SAP ABAP 系统里访问 FTP 服务器
在 SAP ABAP 系统里访问 FTP 服务器
|
5月前
|
XML 网络安全 开发工具
如何下载并安装 SAP ABAPGit,并完成 ABAP 服务器上 SSL 证书的配置试读版
如何下载并安装 SAP ABAPGit,并完成 ABAP 服务器上 SSL 证书的配置试读版
|
5月前
|
存储 Oracle 关系型数据库
服务器数据恢复—RAID5上层SAP+oracle数据恢复案例
**服务器存储数据恢复环境:** 某品牌服务器存储中有一组由6块SAS硬盘组建的RAID5阵列,其中有1块硬盘作为热备盘使用。上层划分若干lun,存放Oracle数据库数据。 **服务器存储故障&分析:** 该RAID5阵列中一块硬盘出现故障离线,热备盘自动激活替换故障硬盘,热备盘同步数据的过程中该raid5阵列中又有一块硬盘出现故障,RAID5阵列瘫痪,上层LUN无法正常访问。 因为本案例中存储控制器的磁盘检查策略严格,一旦某些磁盘性能不稳定,该型号存储控制器就将该块磁盘识别为坏盘,并将该块磁盘踢出RAID。一旦RAID中掉线的盘数到超过RAID级别允许掉盘的最大数量,该RAID将不可用,
服务器数据恢复—RAID5上层SAP+oracle数据恢复案例
|
12月前
|
存储
什么是 SAP ABAP 服务器的 Addon
什么是 SAP ABAP 服务器的 Addon
|
5月前
|
存储 前端开发 搜索推荐
Spartacus SSR fallback 成 CSR 时,仍然会在后端继续保持渲染
Spartacus SSR fallback 成 CSR 时,仍然会在后端继续保持渲染
|
11月前
|
搜索推荐
Spartacus ASM 模式下用户名的大小写问题
Spartacus ASM 模式下用户名的大小写问题
Spartacus ASM 模式下用户名的大小写问题
|
11月前
|
存储 缓存
Spartacus 服务器端渲染(SSR)的 timeout 设置
Spartacus 服务器端渲染(SSR)的 timeout 设置
|
11月前
|
缓存 自然语言处理 前端开发
Spartacus CSR 渲染模式下的 home page 网络请求
Spartacus CSR 渲染模式下的 home page 网络请求
下一篇
无影云桌面