diff --git a/shared/infrastructure/factory.py b/shared/infrastructure/factory.py index 188f581..601012f 100644 --- a/shared/infrastructure/factory.py +++ b/shared/infrastructure/factory.py @@ -341,6 +341,14 @@ def create_base_app( response.headers["HX-Preserve-Search"] = value return response + # Prevent browser caching of static files in dev (forces fresh fetch on reload) + if app.config["NO_PAGE_CACHE"]: + @app.after_request + async def _no_cache_static(response): + if request.path.startswith("/static/"): + response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" + return response + # --- context processor --- if context_fn is not None: @app.context_processor diff --git a/shared/static/scripts/sx.js b/shared/static/scripts/sx.js index 070f0bc..87efa7b 100644 --- a/shared/static/scripts/sx.js +++ b/shared/static/scripts/sx.js @@ -1286,8 +1286,8 @@ kwargs[args[i].name] = sxEval(v, env); } } else { - // Data arrays, dicts, etc — pass through as-is - kwargs[args[i].name] = v; + // Data arrays, dicts, etc — evaluate in caller's env + kwargs[args[i].name] = sxEval(v, env); } i += 2; } else {