关于sap:SAP-Spartacus-服务器端渲染-timeout-和-forcedSsrTimeout-两个参数的区别

3次阅读

共计 1350 个字符,预计需要花费 4 分钟才能阅读完成。

timeout

Time in milliseconds to wait for SSR rendering to happen.

It does not mean the actual duration spent by a SSR rendering request, but the range between the timestamp when SSR receives a render request and that request actually gets processed by SSR server.

期待 SSR 渲染产生的工夫(以毫秒为单位)。

它并不意味着 SSR 渲染申请所破费的理论持续时间,而是 SSR 收到渲染申请时的工夫戳与该申请理论被 SSR 服务器解决之间的范畴。

forcedSsrTimeout

Time in milliseconds to wait for rendering when SSR_ALWAYS render strategy is set for the request.

Default value is 60 seconds.

in file optimized-ssr-engine.ts, we set a timer with timeout value specified by line 130, this.getTimeout function call:

为申请设置 SSR_ALWAYS 渲染策略时期待渲染的工夫(以毫秒为单位)。

默认值为 60 秒。

在文件优化 ssr-engine.ts 中,咱们设置了一个定时器,其超时值由第 130 行指定,this.getTimeout 函数调用:

The logic of final timeout value is determined as below:

  1. if request rendering strategy is specifed explicitly by customers to ALWAYS_SSR, then the timeout is coming from forcedSsrTimeout option. If customers specify ALWAYS_SSR but forget to fill forcedSsrTimeout, then 60 seconds is used as default value.
  2. In most cases customers will use RenderingStrategy.DEFAULT as default strategy. In this case, timeout value comes from option timeout.

In other words, forcedSsrTimeout only takes effect, if customer uses RenderingStrategy.ALWAYS_SSR.

  1. 如果客户明确指定了申请渲染策略到 ALWAYS_SSR,那么超时来自于 forcedSsrTimeout 选项。如果客户指定 ALWAYS_SSR 但遗记填写 forcedSsrTimeout,则应用 60 秒作为默认值。
  2. 在大多数状况下,客户会应用 RenderingStrategy.DEFAULT 作为默认策略。在这种状况下,超时值来自选项超时。

换句话说,只有在客户应用 RenderingStrategy.ALWAYS_SSR 时,forcedSsrTimeout 才会失效。

更多 Jerry 的原创文章,尽在:” 汪子熙 ”:

正文完
 0