My Library Docs

Multi-root Sidebar

flex-layout

  • Getting Started

  • Guides

  • Reference

typed-rx-http

  • Getting Started

  • Guides

  • Reference

global-rx-state

  • Getting Started

  • Guides

  • Reference

webflux-fe-dev-assistant

reactive-mongo-dsl

CSR Cache & Next.js

The browser cache is used with Core's createCsrCache, and /next's callApiSsrCache is added only when Next.js server Data Cache is needed.


The cache wrapper is also part of commonService.

The callApiClientCache/callApiServerCache code on this page explains only the cache part of the project-wide HTTP adapter. Since the generated service can be configured to import this function, it is clearer to first look at the overall structure of rxjsHttpService.ts/commonService.ts to understand the position and role of each wrapper.

CSR Cache (Client Cache)

createCsrCache<CacheName>()provides callApiCsrCache(callApiFn, serviceArgs, cacheOptions) and removeCsrCache(cacheName).

ts

In the server environment, it calls the original callApi without creating a CSR cache map. In the browser, it shares the Observable results of the same cache key using shareReplay.

Do not cache user-specific data.
When bundling browser/server into a single project wrapper

In the shared service, the browser can branch to createCsrCache, and the server can branch to callApiSsrCache. This is a project configuration pattern and not a required structure of Core itself.

commonService.ts
ts
commonService.ts
ts

When using the cache wrapper in the auto-generated service, connect this wrapper only to endpoints that need cache functionality, while using the regular callApi for the rest.

© 2026 Byeolnaerim. All rights reserved.IntroductionPrivacy Policy