Declaw

Long-form prose

Prompt from scowalt/paseo-plain

Original

There are two different questions wrapped up in the suggestion to cache the reports page, and it is useful to separate them before choosing an implementation. One is whether previously calculated report data can be reused without violating the freshness expectation. The other is whether introducing a separate distributed service is necessary to get that reuse. Accepting data that is up to 15 minutes old makes reuse a possibility, but it does not, by itself, establish that a distributed cache is the appropriate first change. We have not measured which part of the current request consumes the most time. The delay could come from the report query, from preparing the response, or from work in the browser, and those possibilities would not all benefit from the same intervention.

There is also a boundary between the freshness of the report and the freshness of the decision about who may read it. The accepted delay applies to report data, not to access permissions. Even if the data comes from a cache, the request must use the current access decision before returning it. Separating cached entries by organization would reduce the chance of mixing organizations' data, but that separation would not replace authorization. A person whose access was removed must not continue to receive the report simply because a cached result still exists. None of this establishes that the current implementation has such a bug; it describes a requirement any proposed cache would have to satisfy.

My recommendation is therefore to measure a representative request before adding the distributed service. If the report query dominates, and equivalent requests recur often enough to make reuse useful, a cache becomes a reasonable candidate. If response preparation or browser work dominates instead, reusing query results may leave the main delay untouched. A distributed cache would also introduce expiration behavior, cache-miss handling, and another service to operate. Those are tradeoffs to evaluate, not proof that caching would be a mistake.

The measurement has not been run, and neither a cache nor an authorization change has been implemented. I would reconsider the recommendation once we know where the delay occurs and whether repeated requests actually share reusable results. Until then, the freshness allowance supports investigating caching; it is not evidence that caching will improve this page.

Paseo Plain

Caching the reports page raises two separate questions: whether old report data can be reused within the allowed freshness delay, and whether a distributed service is needed. Allowing report data to be 15 minutes old makes reuse possible, but we have not measured whether the main delay comes from the report query, response preparation, or browser work.

The freshness allowance applies to report data, not access permissions. Requests must use the current authorization decision before returning cached data. Separating cache entries by organization would reduce the risk of mixing organizations' data, but it would not replace authorization. Someone whose access was removed must not receive the report from an existing cache entry. This is a requirement for a proposed cache, not evidence that the current implementation has this bug.

I recommend measuring a representative request before adding a distributed service. If the query is the main delay and equivalent requests recur often enough, caching may help. If response preparation or browser work is the main delay, reusing query results may not. A distributed cache would also add expiration rules, cache-miss handling, and another service to operate.

The measurement has not been run, and no cache or authorization change has been implemented. I would reconsider the recommendation after we know where the delay occurs and whether repeated requests share reusable results. For now, the freshness allowance justifies investigating caching; it does not show that caching will improve the page.

Credits