Antylogic
DemoApp login

399 operational guides

Docs sections
DocsDocumentation
Device

Load the Docs content cache

Antylogic loads `articles.json` when a `GET` request needs to show the Docs index or an article. The backend keeps the decoded content in memory and reuses it until the file `mtime` advances.

In this article

Use this guide to understand what happens when public help or in-app help shows documentation content. For the operator, the visible effect is that the index and the articles are served from the current Docs bundle.

There is no button or endpoint to force a reload. The next non-asset `GET` request after the bundle is replaced is what lets the backend check the `mtime` and decide whether it must re-read `articles.json`.

Before you start

  • The backend must have the Docs routes registered.
  • `DOCS_CONTENT_PATH` must point to a directory containing `articles.json` or directly to a `.json` file; if it is not set, `./docs-content` is used.
  • `articles.json` must exist and be valid JSON for the backend.
  • `/api/app/docs` requires a valid session with a Bearer token or an `access_token` cookie; `/api/public/docs` does not require a session.
  • For GB captures, use the `restaurant_full_v1-gb` demo session and open `antylogic://docs`.

Instructions

  1. 1.

    Open in-app help

    In the Harbor Demo Group demo session, open `antylogic://docs`. The screen requests the index from `GET /api/app/docs`. If the cache is empty or the file `mtime` has advanced, the backend reads `articles.json`, decodes it and keeps the content in memory.

  2. 2.

    Open a real article

    Open `antylogic://docs/team-access/en-access-users-invite-location`. The detail uses the same service as the index and resolves the article from the documentation bundle that is already loaded or reused.

  3. 3.

    Understand when it reloads

    After the bundle is replaced, the next non-asset `GET` request checks the `mtime`. The JSON is read and decoded again only if that timestamp is later than the one loaded in memory.

  4. 4.

    Tell the internal cache from the HTTP cache

    The internal cache keeps the decoded JSON inside the backend process. `DOCS_CACHE_CONTROL_DEFAULT` controls the HTTP header for index and detail, but it neither forces nor prevents the internal reload of `articles.json`.

Validations and limits

  • `GET /api/public/docs` does not require a session; `GET /api/app/docs` does require valid authentication.
  • `HEAD /api/app/docs` and `HEAD /api/public/docs` respond before loading content, so they do not prove this action.
  • The `/api/*/docs/assets/...` routes are served before `articles.json` is read; they are not evidence of a cache load.
  • If `articles.json` does not exist, the expected response is `503 documentacion no configurada`.
  • If the JSON cannot be read or decoded, the expected response is `500 documentacion no disponible`.
  • If the article does not exist, the detail returns `404 articulo no encontrado`; that does not imply a cache failure if the index loaded correctly.
  • The cache is local to each backend process and is not shared between instances.

Expected result

The Docs index and detail are shown from the current bundle. The backend keeps the content in memory and reuses it until a `GET` request detects a newer `mtime` on `articles.json`.

Related articles