Skip to content

Caching and Performance

Instant filtering moves the work from "every click" to "once per page load". The page itself does more work up front, because it renders every listing card instead of one page's worth. The cache is what keeps that fast.

What gets cached

The first time an instant SRP loads, the extension saves two things to your uploads folder, under wp-content/uploads/dms-instant-filter/:

  • Listing data for the type: each listing's category values, price, status, and dates. One file per listing type, shared by every instant page on that type.
  • Rendered cards: the finished HTML for every listing through a given SRI template. One file per type and template.

Every visitor after that is served from these files. Rendering cards is the slow part (each one is a full Elementor render), so this is where most of the saving comes from.

When the cache refreshes

You don't need to clear anything by hand. The cache for a listing type clears on its own when:

  • a listing of that type is saved, published, trashed, restored, or deleted
  • a category on that type is added or changed (deleting a category clears every type)
  • an import or bulk edit finishes (cleared once at the end, not once per listing)
  • the DMS cache is cleared

As a safety net, every cache file also expires after one hour.

The first page view after any of these rebuilds the cache, so that one view is slower. Everyone after it gets the fast version.

Page caching plugins

A full-page cache (WP Rocket, LiteSpeed, a host-level cache) sits in front of all of this and works fine with it. Just remember it has its own expiry: after you edit a listing, the page cache may still serve the old page until it clears.

Choosing a preload cap

The preload cap is the most listings loaded with the page. Higher means more listings are searchable instantly, but a heavier page.

Listings on the page What to expect
Up to about 300 Light. The default of 500 covers it with room to spare.
300 to 1,000 Fine on most sites once cached. Watch the page size on mobile.
Over 1,000 Test before going live. The page HTML grows with every card.

Listings past the cap are left out completely, oldest first. Set the cap above your inventory size.

To see your real numbers, open the SRP in a private window twice. The first load builds the cache, the second shows what visitors normally get.

For developers

Hook Type Purpose
dms_instant_filter_max_pool_size filter Upper limit on listings read when building the cache for one type. Default 5000.
dms_srp_posts_per_page filter (core) Used to raise the core SRP query to the preload cap.
dms_query_args filter (core) Used so the server always renders the full pool, even for a pre-filtered URL.
dms_get_template filter (core) Used to swap cached card HTML in for the core content-srp.php loop.

Cache files are plain JSON and safe to delete at any time. Deleting the dms-instant-filter folder just forces a rebuild on the next page view.

The extension registers one AJAX action, open to logged-out visitors and nonce-checked: dms_instant_filter_switch_view, which re-renders the current listings through a different SRI template for the view switcher.