Platform
ScaiWave ScaiGrid ScaiCore ScaiBot ScaiDrive ScaiKey Models Tools & Services
Solutions
Organisations Developers Internet Service Providers Managed Service Providers AI-in-a-Box
Resources
Support Documentation Blog Downloads
Company
About Research Careers Investment Opportunities Contact
Log in

Cache invalidation

Delivery caches rendered pages in memory and in Redis. The backend tells delivery what to drop over the Redis pub/sub channel scaicms:cache:invalidate. Both services must share the same Redis.

What invalidates automatically#

Change Clears
Content create, update, delete That content's cached render
Content type change Everything cached for the site, docs included
Template pack upload The pack's templates and every content page on the site — not docs pages
Doc page create, update, delete All cached docs renders
Site settings change Everything for the site

Messages are published by the backend directly when the change commits. The ARQ worker is not involved, so a stopped worker does not stop invalidation (it does stop search indexing).

"I changed content and the site is still stale"#

  1. Watch the channel. The Redis URL needs the ACL user, as in REDIS_URL:
    scdoc
    1
    redis-cli -u "$REDIS_URL" SUBSCRIBE scaicms:cache:invalidate
    
    Make the change. A JSON message should appear. None at all means the backend is pointed at a different Redis than delivery.
  2. Check what you are looking at. Docs responses carry an ETag and Cache-Control. Public pages for anonymous readers are public, max-age=60, so a browser or proxy may hold them for up to a minute. Restricted pages and anything rendered for a signed-in reader are private, no-store. Append ?_nocache=1 to bypass delivery's own cache for one request.
  3. Flush by hand. The message must be JSON. A plain string such as site:<id>:* is logged as invalid and ignored.
    carbon
    1
    2
    redis-cli -u "$REDIS_URL" PUBLISH scaicms:cache:invalidate \
      '{"type":"flush_all","site_id":"<site-id>"}'
    
    With site_id this clears that site's content, navigation, templates and docs renders. Without it, it flushes every site.

"I uploaded a new template pack and docs pages still use the old one"#

Expected: a pack upload clears content pages, not docs renders. Docs pages pick up the new templates after the flush above.

"I updated my JWT secret"#

JWTs from before the change are now invalid — delivery and backend both reject them. Sign out and sign back in.

Updated 2026-11-15 01:58:03 View source (.md) rev 3