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

Neon image

Serverless Postgres in 300ms (!)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

Oldest 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.

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Dive into this informative piece, backed by our vibrant DEV Community

Whether you’re a novice or a pro, your perspective enriches our collective insight.

A simple “thank you” can lift someone’s spirits—share your gratitude in the comments!

On DEV, the power of shared knowledge paves a smoother path and tightens our community ties. Found value here? A quick thanks to the author makes a big impact.

Okay