关于 SAP Spartacus Optimization Engine 里的 cache 参数使用注意事项

简介: 关于 SAP Spartacus Optimization Engine 里的 cache 参数使用注意事项

SAP Spartacus是一款开源的前端电商框架,它通过Storefront来提供优质的购物体验。在Spartacus中,Server-Side Rendering(SSR)是一项重要的性能优化技术,而SSR Optimization Engine则是其中一个关键组件,它通过缓存参数的配置,能够进一步提升性能。cache 参数是一个非常关键的配置项,它直接影响到页面渲染的速度和资源利用效率。

这个参数使用的注意事项:

The cache option should be used with care, as it can lead to high memory consumption, and eventually to restarts of servers.

We recommend to not use the cache option, as there are better options to cache the SSR responses (e.g. using a CDN in front of SSR server(s), but more about this a bit later).

If you really want/need to use the cache option, you should limit the amount of cached responses via cacheSize option, as it helps keeping the memory usage under control.

Moreover, it is recommended to set cacheSize even if you completely turn off cache. This will then limit the number of timed-out renders that are kept in a temporary cache, waiting to be served with the next request, and it should be set according to the server’s resources (e.g. RAM).

Spartacus SSR Optimization Engine 是一个用于优化 Spartacus Server Side Rendering 性能的引擎。其中,cache 参数是一个可选的参数,用于控制缓存的使用。在使用 cache 参数时,需要注意以下几点:

  1. cache 参数默认值为 false,即不启用缓存。如果需要启用缓存,需要将 cache 参数设置为 true。
  2. cacheSize 参数用于控制缓存的大小。cacheSize 参数的默认值为 20,即最多缓存 20 个页面。如果需要缓存更多的页面,可以将 cacheSize 参数设置为更大的值。
  3. 启用缓存后,缓存的页面会被存储在内存中。因此,如果缓存的页面过多,可能会导致内存占用过高,从而影响系统的性能。因此,需要根据实际情况,合理设置 cacheSize 参数的值。
  4. 如果启用了缓存,当用户请求一个已经缓存的页面时,Spartacus SSR Optimization Engine 会直接返回缓存的页面,而不是重新生成页面。这样可以大大提高系统的性能。
  5. 如果启用了缓存,当用户请求一个未被缓存的页面时,Spartacus SSR Optimization Engine 会生成新的页面,并将其缓存起来。这样可以保证用户获得最新的页面内容。
相关文章
|
3月前
|
缓存 前端开发 JavaScript
Spartacus SSR 使用场景里,CDN 应该 cache 哪些类型的页面
Spartacus SSR 使用场景里,CDN 应该 cache 哪些类型的页面
67 0
|
6月前
SAP 电商云 Spartacus UI UrlMatcherService 的用法介绍 - External Route 工作的单步调试(二)
SAP 电商云 Spartacus UI UrlMatcherService 的用法介绍 - External Route 工作的单步调试
33 0
|
6月前
|
网络架构
SAP 电商云 Spartacus UI UrlMatcherService 的用法介绍 - External Route 工作的单步调试(一)
SAP 电商云 Spartacus UI UrlMatcherService 的用法介绍 - External Route 工作的单步调试
39 0
|
6月前
|
缓存 Java C++
SAP 电商云 Spartacus UI Angular UI 和 Accelerator JSP UI 的混合使用
Spartacus 在技术和架构( library 发布方式 vs 模板发布方式,headless vs embedded,Angular vs JSP 技术栈)等各方面,都是一种全面的从 Accelerator 的完整范式转变。因此,对于 Commerce Cloud 已经使用 Accelerator 的客户来说,并没有直接的方法可以从基于 Accelerator 的 Storefront 迁移到使用 Spartacus library 的店面。
44 0
|
6月前
|
JavaScript API Perl
关于 SAP Spartacus SSR 请求 OCC API 遇到 403 错误的解决办法
关于 SAP Spartacus SSR 请求 OCC API 遇到 403 错误的解决办法
65 0
|
6月前
|
Web App开发 安全 JavaScript
SAP 电商云 Spartacus UI 里的 Content Security Policy
SAP 电商云 Spartacus UI 里的 Content Security Policy
58 0
|
6月前
SAP 电商云 Spartacus UI Configurable Product 的页面设置
CPQ,Product Configuration,Product Configure,Product Variant 变体是在某些方面彼此不同但基于相同基本模型的产品。 变体的一个示例是 T 恤的颜色和尺寸。 在 Spartacus 中启用变体功能,并在 SAP Commerce Cloud 中配置产品后,客户可以在店面中选择具有他们选择的变体(或多个变体)的产品。
42 0
|
6月前
关于 SAP Spartacus 电商云 UI feature level 的测试步骤
关于 SAP Spartacus 电商云 UI feature level 的测试步骤
38 0
|
1月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
27 0
|
1月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
15 0