Skip to content

Add a pin to Clear Cache that clears the cache before every query - #165

Merged
IoannisNezis merged 8 commits into
mainfrom
clear-cache-lock
Nov 3, 2026
Merged

IoannisNezis merged 8 commits into
mainfrom
clear-cache-lock

Conversation

@hannahbast

@hannahbast hannahbast commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

When benchmarking or investigating queries, one often wants every query to run on a cold cache, which so far meant pressing Clear Cache by hand before each Execute. This change adds a small pin button right of Clear Cache. While pinned, the cache is cleared before every query (from the button, Ctrl+Enter, an ?exec link, or the re-run in the analysis view), and the query only starts once the clear request has finished. If the clear fails, the query still runs.

  • The pin state is a general setting (clearCacheBeforeExecute), with a checkbox in the settings panel, and is kept per browser in local storage.
  • While pinned, the Clear Cache cell is tinted and a small indicator is shown on Execute.
  • Results of a query that ran right after a successful clear get a "Cold run" badge in the stats bar.
  • Clear Cache itself still works as a one-off click, and a toggleClearCacheBeforeQuery command is registered for the command palette.
  • Canceling while the pre-query clear is still running cancels the query.

Along the way, clearCache now resolves after the backend has answered. Before, the "re-run with cleared cache" action of the analysis view fired the query without waiting, so it could still hit the cache. clearCache also accepts a quiet parameter (clearCache quiet in the command prompt) that suppresses its toasts; the pre-query clear uses it.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

For benchmarking, one wants every query to run on a cold cache without
pressing `Clear Cache` by hand each time. A pin button next to
`Clear Cache` latches that: while pinned, the cache is cleared and the
clear is awaited before each query starts. The state is a general
setting (`clearCacheBeforeExecute`), persisted in local storage, and an
indicator on `Execute` shows when it is active. Results of a query that
ran right after a successful clear are marked with a "Cold run" badge.

`clearCache` now resolves after the backend has answered, which also
fixes the re-run in the analysis view racing the clear against the
query. It accepts a `quiet` parameter to suppress its toasts.
Previously the badge was only updated on success, so a failed or
canceled query after a cold run kept showing it.
With the `Clear Cache` pin set, a cancel during the clear fired before
executeQuery registered its cancel listener, so the query ran anyway.
…ache

With the `Clear Cache` pin set and no endpoint configured, the warning
from the pre-query clear showed up next to the query's own error with the
same message.
Toggles the `Clear Cache` pin from the command palette.
@IoannisNezis IoannisNezis changed the title Add a lock to Clear Cache that clears the cache before every query Add a pin to Clear Cache that clears the cache before every query Nov 3, 2026
@IoannisNezis
IoannisNezis merged commit 50bf449 into main Nov 3, 2026
1 check passed
IoannisNezis added a commit that referenced this pull request Nov 3, 2026
* main: (61 commits)
  FIX: show dataset URL even if the endpoint is unreachable
  Add a pin to `Clear Cache` that clears the cache before every query (#165)
  DEP: update qlue-ls to 3.13.1
  chore(deps): update dependency vite to v8.3.4
  chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.13.0
  chore(deps): update astral-sh/setup-uv action to v10.3.0
  fix(deps): update dependency fastapi to v0.143.0
  chore(deps): update dependency @playwright/test to v1.64.0
  chore(deps): update python to v3.14.8
  chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.12.22
  chore(deps): update dependency @types/node to v25.9.9
  FIX: keep the template editor's model alive on click
  FIX: keep the template editor's model alive on click
  MAINT: add prefix default for wikidata statement
  fix(deps): update dependency fastapi to v0.142.2
  ENH: make numbers in profile more readable
  FIX: only show the grab cursor on the query execution tree canvas
  ENH: show the name of the analysed query in the analysis modal
  ENH: fill in the total time as planning plus execution time
  ENH: show the query planning info in a fold-out of the planning time stat
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants