Skip to content

Dependencies extension: per-render cache round trips and unbounded default-cache growth #154

Closed

Description

@JuroOravec

(Opus 5.5)

While bounding the compiled Vue assets (vue_asset_max_bytes) and making the Vue asset store check a shared cache at most once per asset per minute, a sweep of packages/py/citry/citry/ext/dependencies/ found the same patterns there. Left for a separate change:

  1. Round trips on every render. _cache_component_script (scripts.py) reads the versioned and the stable key with cache.get and compares the full payload on each call, _cache_component_css_vars_capture does the same per distinct css_data() result, and cache_asset calls has (then set) for every served Dependencies file, after which emission.py reads the same key back with get. With Redis this is several network calls per component per render. The helper citry.cache._store_if_missing (remember per engine which keys were seen stored, recheck after an interval, forget on Citry.clear()) fits cache_asset, but emission then reads the entry back and raises TypeError when it is missing, so that read must first fall back to re-storing (or use the content in hand) before the helper can be used safely.

  2. Growth of the default in-memory cache. Each distinct css_data()/js_data() result is stored as its own entry without a TTL. When those values vary per request (a per-user colour, say), the default unbounded InMemoryCache grows with traffic, not with code. The Vue assets now live in a bounded per-process store when no cache is configured; the per-instance variables scripts need a similar decision (a bound, or keeping them out of the shared default cache).

Activity

  1. added 2 commits that reference this issue on Oct 25, 2026
    432e3fb
    ee5cb55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions