Antylogic
DemoApp login

399 operational guides

Docs sections
DocsDocumentation
Device

Cache Loaded Docs Content

Antylogic loads the bundled Docs content file once per backend process for non-asset Docs GET requests and reuses that in-memory bundle while the source file modification time has not advanced.

In this article

Antylogic serves public and app documentation from a bundled articles.json file. When a normal Docs GET request reaches the backend, the Docs content service loads that bundle into memory and uses it for both the Docs index and article detail responses.

Operators see the result as the Docs index and article pages loading from the same published documentation bundle. The cache hit itself is not visible in the UI, so validation should use index and detail GET requests rather than HEAD checks or assets paths.

Before you start

  • The backend Docs routes are registered and running.
  • DOCS_CONTENT_PATH resolves to the bundled Docs content directory or directly to a JSON content file.
  • The deployed Docs content file is readable and decodes successfully. In this repo the bundled source is backend/docs-content/articles.json.
  • For authenticated app Docs, the operator is signed in as Harbor Demo User in Harbor Demo Group / Harbor Soho with English en-GB preferences.
  • Use a non-asset GET request. HEAD requests and /assets/... paths bypass the article bundle loader.

Instructions

  1. 1.

    Confirm the Docs bundle is available

    Before checking Docs in the public or app surface, confirm that the deployed backend can read the Docs content bundle. If DOCS_CONTENT_PATH points to a directory, the backend expects articles.json inside it. If DOCS_CONTENT_PATH points directly to a .json file, that file is used. Missing content returns a docs-not-configured service-unavailable response, while unreadable or invalid JSON returns a docs-not-available internal error response.

  2. 2.

    Open a non-asset Docs index

    Open GET /api/public/docs or the authenticated GET /api/app/docs surface. The first successful non-asset GET after backend start loads the Docs bundle into the process-local cache. Public Docs does not require app authentication; app Docs is handled inside the authenticated route wrapper.

  3. 3.

    Open an article detail from the same surface

    From the Docs index, open an article detail. For the GB capture plan, use GET /api/app/docs/access/en-access-users-create-location-internal. When the source file modification time has not advanced, the detail response is built from the same loaded bundle used by the index.

  4. 4.

    Know when fresh content is served

    After articles.json is replaced with a later modification time, the next non-asset Docs GET reloads the bundle and replaces the cached content for that backend process. If the file changes with the same or an older modification time, the process keeps serving the cached bundle until restart or until the file receives a later modification time.

  5. 5.

    Avoid bypass paths for cache checks

    Do not use HEAD /api/public/docs, HEAD /api/app/docs, or GET /api/*/docs/assets/{path} to verify bundle loading. HEAD returns before loading the bundle, and asset requests are served before docsContentService.load runs.

Validations and limits

  • Only GET and HEAD are accepted by handleDocs; other methods are rejected before content loading.
  • docsContentService.load stats the resolved content file before checking the cache or reading JSON.
  • The cache hit condition is based on the current file modification time not being after the cached modification time.
  • Public and authenticated Docs share the same docsContentService instance created during route registration.
  • Locale, platform, theme, query filtering, article lookup, and media URL resolution happen after the shared bundle is loaded and do not create separate content caches.
  • The cache is process-local and is not distributed across backend instances.
  • No dedicated repository test was found for mtime-based cache invalidation.

Expected result

Operators can validate that the Docs index and detail pages are available from the same published bundle, while understanding that actual reload behaviour is controlled by the backend process and the content file modification time.

Related articles