mage2tv / magento-cache-clean

A faster drop in replacement for bin/magento cache:clean with file watcher
BSD 3-Clause "New" or "Revised" License
527 stars 61 forks source link

Flush all needed caches when saving csp_whitelist.xml #85

Closed complexthings closed 3 years ago

complexthings commented 3 years ago

We run mage2tv/magento-cache-clean through node/gulp in warden using the following (paired down):

import chalk from 'chalk';
import { spawn } from 'child_process';

const cacheClean = spawn('vendor/bin/cache-clean.js', ['--watch']);

cacheClean.stdout.on('data', (data) => {
    console.log(chalk.blue(`Magento Cache Clean: ${data}`));
});

cacheClean.stderr.on('data', (data) => {
    console.log(chalk.red(`Magento Cache CLean: ${data}`));
});

cacheClean.on('close', (code) => {
    console.log(chalk.yellow(`Magento Cache Clean exited with code ${code}`));
});

When I edit a csp_whitelist.xml I see the following output:

Magento Cache Clean: 18:36:50 Cleaning id(s): global::csp_whitelist_config frontend::csp_whitelist_config adminhtml::csp_whitelist_config webapi_rest::csp_whitelist_config webapi_soap::csp_whitelist_config graphql::csp_whitelist_config

But if I refresh the page I will still see the same items reported as being refrused. Yet if I run just straight up vendor/bin/cache-clean.js Flushing all the caches and then refresh my browser the items no longer report. I think there's some additional caches that need to be flushed when you watch and modify a csp_whitelist.xml

Also, this is one of my favorite tools, keep up the great work bud!

complexthings commented 3 years ago

Accidentally submitted twice.