Stock Snapshot background caching

The Stock Snapshot report uses a background cache to speed up large date-range queries. Here is what each stage looks like and what you can do.

First load of a new date range

When you request a date range that has not been loaded before (or whose cache has expired), the report:

  1. Queues a background build job — the heavy query runs off-request so it can complete without a browser timeout.
  2. Shows a "Preparing report data…" dialog with an estimated wait time (typically around 30 seconds).
  3. Automatically retries up to five times until the data is ready, then loads the grid.

You can click Cancel in the dialog at any time. The background build continues even after you cancel, so if you reopen the same range it will usually be ready immediately.

The cache banner

Once the report loads from a cached build, a banner appears above the grid showing:

  • The selected date range.
  • Snapshot as of [timestamp] — when the cached data was last computed.
  • A Refresh button.

If inventory receiving data has been edited and the change falls inside your selected window, the banner changes to:

Data may be outdated — refresh to recompute

This stale notice is automatic — you do not need to track receiving edits manually.

When to use Refresh

Click Refresh when:

  • The banner shows the stale warning after a receiving date was edited.
  • You have just posted new receipts and want the snapshot to reflect them.
  • You want to re-run the report with the same date range after any inventory activity.

Refresh queues a new background build. Concurrent users continue seeing the previous (still-valid) numbers while the rebuild runs, so the report stays available throughout.

Cache scope

The cache is keyed on the full combination of date range, valuation basis (average vs. cost-layer), the "Include All Zero Stock" toggle, and any active SKU / product name / supplier filters. Changing any of these produces a fresh cache for that combination.

Troubleshooting

SymptomWhat to do
Dialog appears every time for the same rangeThe previous cache may have failed. Click Refresh once the report loads, or try a narrower range first.
"Preparing report data" dialog after clicking RefreshNormal — the rebuild runs in the background. The dialog closes automatically when it is ready.
Stale banner appears without any intentional receiving editA receiving report's date field may have been updated. Click Refresh to recompute.
Report never finishes after 5 retriesThe query may be too large for your catalog size. Try narrowing the date range or filtering by SKU.

Note: This feature is rolling out progressively. If you do not see the cache banner or the background-build dialog, your account may not have it enabled yet — contact support to learn more.