Cache management

The Adobe Commerce and Magento Open Source cache management system provides an easy way to improve the performance of your site. Whenever a cache requires a refresh, a notice appears at the top of the workspace to guide you through the process. Follow the link to Cache Management and refresh the invalid caches.

w-500
Save product attribute - update cache message
NOTE
When catalog entities are changed, it can affect other pages and invalidate multiple caches simultaneously. When you review the cache management page, you could see invalid items that require refresh when they were not edited directly. For example, this invalidation occurs when you edit any product in the catalog and it is assigned to any category, or when you change any related product rule.

The Cache Management page shows the status of each primary cache and its associated tag. The large buttons in the upper-right corner can be used to flush the cache, or the all-inclusive Cache Storage. At the bottom of the page, there are additional buttons to flush the catalog product images cache and JavaScript/CSS cache.

After clearing a cache, always refresh your browser to make sure that you can see the most recent files. Clearing the Commerce cache does not clear your web browser cache. You may need to clear the browser cache to see updated content.

For additional technical information, see Cache overview in the Commerce Frontend Development Guide.

Access the Cache Management page by doing one of the following:

  • Click the Cache Management link in the message above the workspace.
  • On the Admin sidebar, go to System > Tools > Cache Management.
w-700 modal-image
Cache management

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 may access the site such as late night or early morning. Clearing some cache types during peak times cause result in a high load on the Admin and may result in a down site until completed.
  • When reindexing, you do not need to also perform a flush cache.

Cache management role resources

Access to specific cache maintenance actions can be assigned 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.

w-600 modal-image
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 of each cache to be targeted by the action.

  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, click Flush JavaScript/CSS Cache to clear any JavaScript and CSS files that have been merged into a single file.

    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

Commerce provides additional flush cache options using the command line. These options may require developer support to complete. For complete details and command options, see Manage the cache in the Configuration Guide.

Controls

Control
Description
Mass Actions
Selects the checkbox of multiple caches. Options:
Select All — Selects the checkbox of all caches.
Unselect All — Clears the checkbox of all caches.
Select Visible — Selects the checkbox of all visible caches.
Unselect Visible — Clears the checkbox of all visible caches.
Actions
Determines the action to be applied to all selected caches. Options:
Enable — Enables all selected caches.
Disable — Disables all selected caches.
Refresh — Refreshes all selected caches.
Submit
Applies the action to all selected caches.

Buttons

Button
Description
Flush Magento Cache
Removes all items in the default Commerce cache (var/cache), according to their associated Commerce tags.
Flush Cache Storage
Removes all items from the cache, regardless of Commerce tag. If your system uses an alternate cache location, any cached files used by other applications are removed in the process.
Flush Catalog Images Cache
Removes all automatically resized and watermarked catalog images that are stored in media/catalog/product/cache. If recently uploaded images are not reflected in the catalog, try flushing the catalog and refreshing your browser.
Flush JavaScript/CSS Cache
Removes the merged copy of JavaScript and CSS files from the cache. If recent changes to the style sheet or JavaScript are not reflected in the store, try flushing the JavaScript/CSS cache and refreshing your browser.
Flush Static Files Cache
Removes preprocessed view files and static files.

Caches

Cache
Description
Associated tag
Configuration
Various XML configurations that were collected across modules and merged.
System - config.xml, local.xml
Module - config.xml
CONFIG
Layouts
Layout building instructions.
LAYOUT_GENERAL_CACHE_TAG
Blocks HTML output
Page blocks HTML.
BLOCK_HTML
Collections Data
Collection data files.
COLLECTION_DATA
Reflection Data
Clears API interface reflection data, that typically is generated during runtime.
REFLECTION
Database DDL operations
Results of DDL queries, such as describing tables or indexes.
DB_DDL
Compiled Config
Results of code compilation.
COMPILED_CONFIG
EAV types and attributes
Entity types declaration cache.
EAV
Customer Notification
Temporary notifications that appear in the user interface.
CUSTOMER_NOTIFICATION
Integrations Configuration
Integration configuration file.
INTEGRATION
Integrations API Configuration
Integrations API configuration file.
INTEGRATION_API_CONFIG
Page Cache
Full page caching.
FPC
Translations
Translation files.
TRANSLATE
Web Services Configuration
REST and SOAP configurations, generated WSDL file.
WEBSERVICE
Target Rule
Target Rule Index
TARGET_RULE

Full-page caching

Adobe Commerce and Magento Open Source use full-page caching on the server to quickly display category, product, and CMS pages. Full-page caching improves response time and reduces the load on the server. Without caching, each page might need to run blocks of code and retrieve information from the database. However, with full-page caching enabled, a fully generated page can be read directly from the cache.

NOTE
It is recommended that Varnish Cache be used only in a production environment.

Cached content can be used to process the requests from similar types of visits. As a result, pages shown to a casual visitor might differ from those shown to a customer. For the purposes of caching, each visit is one of three types:

  • Non-sessioned - During a non-sessioned visit, the shopper views pages, but does not interact with the store. The system caches the content of each page viewed and serves them to other non-sessioned shoppers.
  • Sessioned - During a sessioned visit, shoppers who interact with the store — through activities such as comparing products or adding products to the shopping cart — are assigned a session ID. Cached pages that are generated during the session are used only by that shopper during the session.
  • Customer - Customer sessions are created for those who have registered for an account with your store and shop while logged in to their accounts. During the session, customers can be presented with special offers, promotions, and prices that are based on their assigned customer group.

For technical information, see Configure and Use Varnish and Use Redis for the Commerce page and default cache in the Configuration Guide.

To configure the full-page cache:

  1. On the Admin sidebar, go to Stores > Settings > Configuration.

  2. In the left panel, expand Advanced and choose System.

  3. Expand Expansion selector the Full Page Cache section.

    img-md
    w-600 modal-image
    Advanced configuration - full page cache
  4. Set Caching Application to one of the following:

    • Built-in Application
    • Varnish Caching
  5. To set the timeout for the page cache, enter the TTL for public content. (The default value is 86400)

  6. If using Varnish, complete the Varnish Configuration section as follows:

    • Access list - Enter the IP addresses that can purge the Varnish configuration to generate a config file. Separate multiple entries with a comma. The default value is localhost.

    • Backend host - Enter the IP address of the backend host that generates config files. The default value is localhost.

    • Backend port - Identify the backend port that is used to generate config files. The default value is: 8080.

    • Grace period - Specify the number of seconds to use as a grace period to generate config files. See Advanced Varnish configuration in the Configuration Guide.

    • To export the configuration as a varnish.vcl file, click the button for the version of Varnish that you use.

    img-md
    w-600 modal-image
    Advance configuration - full page cache varnish
  7. When complete, click  Save Config.

recommendation-more-help
d3c62084-5181-43fb-bba6-1feb2fcc3ec1