Skip to content
IvaSure add-ons and services for SureCart storesJoin the POD waitlist

Caching, the index table and operations

2 min read
Published

Filtering asks the database a lot of questions. Several caching layers keep that affordable, and the Cache and URLs tab shows their state and the controls for clearing them.

What is cached

A cache behaviour card with a cache duration dropdown reading 1 hour, a custom cache field reading 3600 seconds, and a cache key prefix field.
Cache behaviour on the Cache and URLs tab.
CachedLifetimeCleared by
Rendered term treesOne hour by default, configurableAny term change, immediately
Facet countsFive minutesTime
Price boundsFive minutesTime
Variant option listsFive minutesTime

Term-based caches are versioned rather than deleted. Creating, editing or deleting a term, or changing term metadata, bumps a version number, and every fragment built under the old version is superseded at once. There is no window in which a stale tree can be served.

The five-minute caches expire on time, not on change
Counts, price bounds and variant lists are recomputed on a timer. Publish a product and its count can be up to five minutes behind - which is why a count that looks wrong is usually just young. Each of those lifetimes is filterable in PHP if five minutes is wrong for your store.

The index table

IvaSure maintains its own table of which products carry which terms. Filtering can answer from that instead of from a chain of joins, which is what keeps a large catalogue responsive.

It is an accelerator, not a source of truth
If the index is missing, stale or empty, filtering falls back to querying WordPress directly. Results stay correct; they just cost more. Nothing breaks because the index is behind - so repairing it is a performance task, never an emergency.

A bounded repair job runs on cron and rebuilds the table in slices, so a large catalogue does not have to be rebuilt in one request. The tab shows index health and lets you start a repair by hand.

When something looks stale

  1. Wait five minutes. Counts, price bounds and variant lists are on a timer, and most reports of a wrong count are a cache that has not turned over yet.
  2. Check the term actually changed. A term edit bumps the version immediately; a product edit does not.
  3. Clear the caches from the Cache and URLs tab if it still looks wrong.
  4. Repair the index if counts are right but the store feels slow.
Page caches are a separate problem
A full-page cache in front of WordPress will serve a filtered URL from its own store, and IvaSure cannot invalidate it. If a filtered view is stale for everyone and clearing IvaSure’s caches changes nothing, clear the page cache next.

Rate limiting

The REST endpoint that serves live filtering is rate limited per minute - more generously for signed-in users than for anonymous ones. A shopper who trips it keeps the products already on screen rather than being shown an error, and the next request works.

Save to list