关于sap:关于-SAP-Spartacus-SSR-345-版本优化的-reuseCurrentRendering-flag

4次阅读

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

concurrency: 50 means that OptimizedSsrEngine will perform at most 50 parallel rendering tasks.

反对同时解决 50 个并发渲染申请。

With the option reuseCurrentRendering enabled, it means: At most 50 different URLs can be rendered at once (regardless the number of parallel requests).
That implies: if you send parallel requests for 51 or more different URLs at once, then the reuqests for the 51st URL (and more) will fallback immediately to CSR. And it’s by design.

开启这个 reuseCurrentRendering 之前,如果第一个申请在渲染 url A,则进来的其余申请渲染同一个 url 的 HTTP request,会立刻 fallback 成 CSR.

开启之后,这些其余申请会期待第一个申请渲染完结,或者到这些其余申请自身的 timeout 产生。

Moreover, it you enable debug:true, then you’ll see the console message CSR fallback: Concurrency limit exceeded

请留神 concurrency: 50(在 SsrOptimizationOptions 中)意味着 OptimizedSsrEngine 最多将执行 50 个并行渲染工作。

启用选项重用以后渲染,这意味着:一次最多能够渲染 50 个不同的 URL(不论并行申请的数量)。

换言之,如果一次发送 51 个或更多不同 URL 的并行申请,则第 51 个 URL(以及更多)的申请将立刻回退到 CSR。这是设计使然。

此外,如果启用 debug:true,那么将看到控制台音讯 CSR fallback:

Concurrency limit exceeded

正文完
 0