DEV Community

Rafael Corrêa Gomes
Rafael Corrêa Gomes

Posted on • Edited on • Originally published at blog.rafaelcg.com

1 1

Magento 2: cache clean vs cache flush

During the development we constantly use the Magento feature to clean or flush the cache, but do you know the difference? Check it out this difference based on DevDoc.

php bin/magento cache:clean

Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not affect other processes or applications because it cleans only the cache that Magento uses.

Disabled cache types are not cleaned.

php bin/magento cache:flush

Flushing a cache type purges the cache storage, which might affect other processes applications that are using the same storage.

Reference: DevDocs Manage the cache

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (1)

Collapse
 
janesmith profile image
Jane Smith

In short, we can use cache:clean for specific tasks and cache:flush for a full reset.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay