SAP Spartacus 服务器端渲染优化引擎的参数 SsrOptimizationOptions
-
timeout?: number - Time in milliseconds to wait for SSR rendering to happen.單位毫秒,等待 SSR 渲染發生的時間間隔。
-
cache?: boolean - Enable in-memory cache for pre-rendered urls.If disabled, the cache will still be used to temporarily store renders finished after csr fallback in order to serve them with next request only.
啟用提前渲染 url 的內存中緩存。如果禁用,仍然會使用緩存來存儲回退到 CSR 渲染機制下生成的頁面,并服務于且僅服務于下一次到來的請求。
- cacheSize?: number - Specified number of entries that will be kept in cache, allows to keep memory usage under control.
指定能夠存儲在緩存里的記錄條目數,防止出現 out of memory 錯誤。
Can also be use when cache option is set to false. It will then limit the number of renders that timeouts and are kept in temporary cache, waiting to be served with next request.
即使 cache 設置為 false,也能夠使用 cacheSize 選項。當 cache 為 false 時,cacheSize 可以用來限制臨時緩存里的 render 個數,這些 render 都是出現了超時情況,等待下次請求到來時繼續服務。
-
concurrency?: number - Limit number of concurrent rendering
-
ttl?: number - Time in milliseconds after prerendered page is becoming stale and should be rendered again.
ttl 時間間隔達到后,之前渲染好的頁面被標識為過期狀態,需要重新渲染。
- renderKeyResolver?: (req: Request) => string - Allows overriding default key generator for custom differentiating between rendered pages. By default it uses req.originalUrl.
允許客戶自定義渲染頁面的標識鍵。默認情況下,使用字段 req.originalUrl 來標識不同的渲染頁面。
- renderingStrategyResolver?: (req: Request) => RenderingStrategy - Allows defining custom rendering strategy per request
相當于鉤子函數,允許根據請求來自定義渲染策略。
- forcedSsrTimeout?: number - Time in milliseconds to wait for rendering when SSR_ALWAYS render strategy is set for the request.Default value is 60 seconds.
當渲染策略設置成 SSR_ALWAYS 時,渲染的超時時間。默認是 60 秒。
總結
以上是生活随笔為你收集整理的SAP Spartacus 服务器端渲染优化引擎的参数 SsrOptimizationOptions的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SAP Spartacus 服务器端渲染
- 下一篇: 魔兽世界8.0库尔提拉斯在哪 库尔提拉斯