What is RAD Cache

RAD Cache stores rendered route output and content payloads on disk to reduce DB and template work.

  • Location: rad/data/cache/{ms_name}/route_{route_id} or content_{content_id}.
  • Routes are cached only for public GET requests without a logged-in session.
  • Cache entries auto-expire by TTL and can be purged manually.

How it is maintained (backend)

Cache entries are created by the runtime and stored with metadata.

  • Variant keys are derived from URL segments + query (filtered), host, and space_id.
  • Payload is stored with created_at and ttl in a JSON wrapper (base64 payload).
  • Expired entries are removed on next read.

How to use (developer)

Override cache behavior in route/content/DM definition or pass cache options in code.

Route cache override (s_msroute.s_definition)


{
"cache": {
"enabled": "Y",
"ttl": 300
}
}

DataRecord list with DM cache


$records = $dataRecord->list('a_tasks', ['livestatus' => 1], 50, 0, ['id' => 'DESC'], [
'cache' => [
'ms_name' => $this->runData['ms']['name'],
'dm_id' => 12,
'space_id' => $this->runData['route']['space_id'] ?? 0,
'ttl' => 300
]
]);

Bypass cache for a request

Use ?nocache=1 on the URL to bypass.

How to manage (admin/user)

Use Governance → Cache to purge entries.

  • Mass purge clears all cached entries.
  • Purge by microservicelet, type, or specific item.
  • Use purge after code deployment or template/content updates.

Config parameters

Stored in s_config (origin=S).

Handle Description Example
rad_cache_enabled Y/N to enable cache globally. Y
rad_cache_ttl Default TTLs in seconds. {"default":300,"route":300,"dm":300,"content":600}
rad_cache_variant_defaults Controls which inputs build the variant key. {"segments":true,"query":true,"space":true,"host":true}
rad_cache_ignore_query Query params ignored when building variants. ["debug_block","nocache","t","_","utm_source","utm_medium","utm_campaign","utm_term","utm_content"]

Troubleshooting

Common reasons for cache misses.

  • Route is private or user is logged in (cache disabled by design).
  • Request is POST/PUT/DELETE (cache only for GET).
  • debug_block=1 or nocache=1 is present.
  • TTL expired or cache purged.