Best Practices for caching

Reindexing and caching have different purposes in Commerce. Indexes track database information for increased search performance, faster data retrieval for storefronts, and more. Caches save loaded data, images, formats, and the like for increased performance loading and accessing the storefront.

  • Always flush the cache after installing extensions/modules. You can install one or more extensions, then flush the cache.
  • Flush the cache after installing Commerce. For fresh installs, you should also reindex.
  • Flush the cache after upgrading from one version of Open Source or Commerce to another.
  • When flushing caches, consider the type of cache and scheduling the flushing during non-peak times. For example, pick a time when few customers use the site such as late night or early morning. Clearing cache types during peak demand can increase load on the Admin and cause the site to go down until the operation completes.
  • When reindexing, you do not need to flush the cache.

Cache management role resources

You can assign access to specific cache maintenance actions to users by role, including options to view, toggle, and flush caches. Adobe recommends enabling flush actions only for administrator level users. Providing access to all Cache Management features can impact your storefront’s performance.

Role resources - cache management

For information about assigning resources to grant access for Admin user accounts, see Role resources. The following resources control access to the cache management tools:

  • Clean Cache Actions

    • Flush Cache Storage
    • Flush Magento Cache
  • Cache Type Management

    • Toggle Cache Type
    • Refresh Cache Type
  • Additional Cache Management

    • Catalog Images Cache
    • Flush Js/Css
    • Flush Static Files

Refresh specific caches

  1. For each cache to be refreshed, select the checkbox at the beginning of the row.

  2. Set Actions to Refresh and click  Submit.

Perform mass action refresh

  1. To select a group of caches, set Mass Actions to one of the following:

    • Select All
    • Select Visible
  2. Select the checkbox for each cache to refresh.

  3. Set Actions to Refresh and click  Submit.

Flush the product image cache

  1. Under Additional Cache Management, click Flush Catalog Images Cache to clear pre-generated product image files.

    The Image cache was cleaned message appears at the top of the workspace.

  2. Clear the cache of your browser.

Flush the JavaScript/CSS cache

  1. Under Additional Cache Management, clear Javascript and CSS files that have been merged into a single file by clicking Flush JavaScript/CSS Cache.

    The The JavaScript/CSS cache has been cleaned message appears at the top of the workspace.

  2. Clear the cache of your browser.

Flush using the command line

System Administrators and developers with access to the Commerce application server can also manage the cache and cache configuration from the command line using the Commerce CLI. See Manage the cache in the Configuration Guide.