Skip to content
msCatalyst
msCatalyst
Faceted filter, search and catalog sync for miniShop2 and MiniShop3
  • MODX 2
  • MODX 3
  • miniShop2
  • miniShop3
  • PHP 7.2
  1. Extras
  2. msCatalyst
  3. System settings and cache

System settings and cache ​

System settings ​

All settings are easier to edit on the "Settings" tab of the component page: it has hints and value checks.

KeyDefaultDescription
mscatalyst_frontend_css[[+assetsUrl]]css/mscatalyst.cssStylesheet file. Empty: no styles are added.
mscatalyst_frontend_js[[+assetsUrl]]js/mscatalyst.jsScript file. Empty: no AJAX, the filter works as a GET form.
mscatalyst_cache_lifetime21600Seconds. A memory index older than this is rebuilt in the background, and the sitemap is built again. 0 keeps the index until the cache is cleared, -1 disables the cache (for debugging only).
mscatalyst_index_modememorymemory: index in the MODX cache. table: in the core/cache/mscatalyst_index/ files. auto: pick by product count.
mscatalyst_index_auto_threshold8000From this many products, auto mode stores the index in files.
mscatalyst_seo_modeoffSEO mode when the call has no &seo, see SEO.
mscatalyst_seo_index_max2How many selected values a friendly URL page may have and stay indexable. 0: every filtered page gets noindex.
mscatalyst_seo_emptynoindexWhat a friendly or landing URL answers when no products match. noindex: the page gets noindex. 404: page not found. show: a normal page.
mscatalyst_seofilter_placeholdersNoFill the sf.* placeholders on filtered pages for templates built for SeoFilter. The import from SeoFilter turns it on, see Moving from SeoFilter.
mscatalyst_seo_title_filtered — Filtered page title.
mscatalyst_seo_h1_filtered: Filtered page H1.
mscatalyst_seo_description. . Найдено: Filtered page description.
mscatalyst_search_synonymsJSON of search synonyms, for example {"шланг":"рукав,hose"}.
mscatalyst_search_logYesRecord shoppers' search queries in the log.
mscatalyst_search_log_days365Days without repeats after which a query leaves the log. 0: keep everything.
mscatalyst_rest_paramsNoLet connector.php requests set parents, facets and searchFields, see REST.
mscatalyst_legacy_markupNoAdd msf-* classes for styles written for msFacets. Turned on automatically on upgrade.
mscatalyst_sync_pathFolder for source files and 1C exchange files. Empty: core/cache/mscatalyst_sync/. The folder is closed to browsers.
mscatalyst_sync_chunk200How many source rows are handled in one pass. Lower it on weak hosting.
mscatalyst_sync_step_seconds20Sync step length in seconds. Keep it below max_execution_time.
mscatalyst_sync_keep_days90Days to keep sync runs and their change journal for rollback. 0: no age limit, up to 1000 runs per profile.
mscatalyst_sync_images_pathFolder for photos from the source. Empty: assets/images/products/.
mscatalyst_sync_images_urlURL of the same folder. Empty: /assets/images/products/.
mscatalyst_demo_adminNoPublic demo admin. For a demo site only.

Filter sets are stored in mscatalyst_set_<name> settings, see Filter sets.

Cache and index ​

msCatalyst builds a catalog index: facet values, sort values and search strings of every product in the category. Counting and filtering run on the in-memory index, without database queries on every click.

ModeWhere it is storedUse for
memoryThe core/cache/mscatalyst/ cache partitionCatalogs up to a few thousand products.
tableFiles in core/cache/mscatalyst_index/Large catalogs. On 100,000 products a filter request takes 25–40 ms.
autoPicked by mscatalyst_index_auto_thresholdWhen the product count is not known in advance.

When you save, publish, unpublish, delete, undelete, duplicate or move a product or category, empty the trash or run an msCatalyst sync, the plugin marks the index stale. The index itself stays. The new index is built in the background, and visitors get the previous one until the build ends, without waiting for it.

  • Under PHP-FPM the build runs in the same request after the response is sent.
  • On Apache with mod_php and other servers the site sends itself a request to the same page with the secret mscatalyst_rebuild parameter. That request answers at once and builds the index after the answer.
  • If the site cannot request itself, these requests pause for an hour, the reason goes to the MODX error log, and the visitor request builds the index. Other visitors still get the previous index.

Clearing the site cache drops the index. The first request builds it again, and concurrent requests wait for that build instead of starting their own. The wait lasts twice the last build time, 60 to 300 seconds.

A memory index older than mscatalyst_cache_lifetime is rebuilt in the background, the same way as a stale one. Visitors keep the previous index meanwhile. When the MODX cache refuses the index (Memcached stores up to 1 MB per item), msCatalyst logs a warning and keeps the index in core/cache/mscatalyst_index/ files.

The plugin does not see imports through the API or direct database queries. After such an import, run MsCatalyst::markStale($modx); and the index is refreshed the same way as after a product save. To drop the index:

  • click "Clear index" on the "Index" tab of the component page;
  • or call the [[!msCatalystReindex]] snippet;
  • or run MsCatalyst::clearIndex($modx);.