mage2tv / magento-cache-clean Goto Github PK
View Code? Open in Web Editor NEWA faster drop in replacement for bin/magento cache:clean with file watcher
License: BSD 3-Clause "New" or "Revised" License
A faster drop in replacement for bin/magento cache:clean with file watcher
License: BSD 3-Clause "New" or "Revised" License
Hi @JDavidVR, I moved your issue into it's own thread because it's not related to windows compatibility.
Your original post is below:
Hi @Vinai,
First of all, thanks for such a useful tool for magento development, today I've upgraded to version .28 and I am facing an issue reported here, in my case I am a mac user, so I am attaching the log issue, magento version EE-2.2.6
composer global show
Changed current directory to /Users/david/.composer
mage2tv/magento-cache-clean 0.0.28 A faster drop in replacement for bin/magento cache:clean with file watcher
Cleaning cache type(s) block_html full_page
fs.js:122
throw err;
^
Error: ENOENT: no such file or directory, unlink '/Volumes/HOME/projects/m2/umgsubs226/var/cache/mage--5/mage---c34_BLOCK_3312FB7323BCBD5F5A27C1FF5E2CD195BF04B592'
at Object.unlinkSync (fs.js:975:3)
at Nh (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:331:292)
at Ti (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:353:525)
at /Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:358:125
at /Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:316:275
at X.g.da (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:207:133)
at eb (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:104:350)
at pg (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:316:238)
at Ui.g.Db (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:358:85)
at bi (/Users/david/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:337:57)
magento@dev:~/html$ vendor/bin/cache-clean.js --watch
Sponsored by https://www.mage2.tv
[ERROR] ENOSPC: no space left on device, watch '/var/www/html/vendor/magento/module-admin-notification/Model/ResourceModel/System/Message/Collection'
This error confuses me - what's meant by "space"?
There's 30G space available on the system and over 3.5G of RAM during runtime.
I have installed module but while running below the command it gives an error
vendor/bin/cache-clean.js --watch
Error: /usr/bin/env: ‘node’: No such file or directory
/data/web/magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:289
function Sf(a){a:for(var b=a;;)if(b=M(b))b=F(b);else break a;return a}function Tf(a,b){if("string"===typeof b)return a=a.exec(b),null==a?null:1===R(a)?E(a):Pe(a);throw new TypeError("re-find must match against a string.");}
^
TypeError: re-find must match against a string.
at Tf (/data/web/magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:289:169)
at sk (/data/web/magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:396:78)
at /data/web/magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:397:101
at d (/data/web/magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:322:135)
at FSWatcher.<anonymous> (/data/web/magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:321:138)
at FSWatcher.emit (events.js:180:13)
at FSEvent.FSWatcher._handle.onchange (fs.js:1384:12)
In the magento admin, often the message "Some or more caches are invalidated" is displayed.
Often this message is not actually true. The cache records where already removed, however, the cache state is also saved as a cache record.
Out of the box the specific cache has to be cleaned through the UI, or a complete flush has to be made, to get rid of the message.
I would like to have a special "type" so I can get rid of the message via the command line, without doing a full cache flush.
Something like cache-clean.js notice
. There could also be a hotkey for that action.
It would remove only the cache record by ID that saves the cache invalidation state.,
The cache should be cleared.
The following error is thrown:
$ vendor/bin/cache-clean.js
Sponsored by https://www.mage2.tv
Flushing all caches
events.js:167
throw er; // Unhandled 'error' event
^
Error: Redis connection to /tmp/redis.sock:6379 failed - getaddrinfo ENOTFOUND /tmp/redis.sock /tmp/redis.sock:6379
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
Emitted 'error' event at:
at RedisClient.on_error (/Volumes/Development/Sites/mage22/vendor/mage2tv/magento-cache-clean/node_modules/redis/index.js:406:14)
at Socket.<anonymous> (/Volumes/Development/Sites/mage22/vendor/mage2tv/magento-cache-clean/node_modules/redis/index.js:279:14)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
Here is my Redis configuration, which works fine with Magento:
'session' => [
'save' => 'redis',
'redis' => [
'host' => '/tmp/redis.sock',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => '',
'database' => '3',
'compression_threshold' => '2048',
'compression_library' => 'gzip',
'log_level' => '1',
'max_concurrency' => '6',
'break_after_frontend' => '5',
'break_after_adminhtml' => '30',
'first_lifetime' => '600',
'bot_first_lifetime' => '60',
'bot_lifetime' => '7200',
'disable_locking' => '0',
'min_lifetime' => '60',
'max_lifetime' => '2592000'
]
],
'cache' => [
'frontend' => [
'default' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => '/tmp/redis.sock',
'port' => '6379',
'database' => '5'
]
],
'page_cache' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => '/tmp/redis.sock',
'port' => '6379',
'database' => '4',
'compress_data' => '0'
]
]
]
],
Hi, and thanks for the wonderful module.
I've spent some time making the module work on Docker, and I can confirm it's working fine. But I've stumbled upon some issues. The module makes two php calls, which obviously can't work inside a node container, and I don't find it a good idea to use mixed purpose containers (php+node). Fortunately, the calls are really simple so I've just run them and saved the output:
php -r "require 'app/vendor/autoload.php'; foreach ((new \Magento\Framework\Component\ComponentRegistrar)->getPaths('module') as \$m) echo \$m.PHP_EOL;" > modules.cfg
php -r "echo json_encode( require 'app/etc/env.php' ?? []);" > settings.cfg
This can be easily run inside the php container and stored in a location of your choice. After that, I've just rewritten the cache-clean.js to use the two saved files. I am not fluent enough with closurescript to do a PR, but it will be a nice option to check first for a static file with configuration, and if not present then proceed with php calls. This will allow some further customizations like having a more fine-grained filter for watch locations. I don't think I need to watch for files inside vendor, or at least not for all of them.
As soon as constructor arguments are updated, interceptors under generated/code/Namespace/Module/Path/To/Class.php
should be deleted. Otherwise, the following error will occur:
Type Error occurred when creating object: Namespace\\Module\\Path\\To\\Class\\Interceptor
This just happened to me with cache-clean.js
version 0.0.33
while updating the constructor arguments for a controller. I simply added another dependency.
Thanks Vinai!
Description
after installing cache-clen.js tool globally and node js, I have added the cache-clean tool to PHP Storm startup but I did not found nodejs.console in the registry to check on it. and it does not detect any change automatically while running it from the command:
~/.composer/vendor/bin/cache-clean.js -w
Specifications
Expected result
Actual result
Is it possible to clean cache for tests?
s.th. like "magento/dev/tests/integration/tmp/sandbox-0-98ce46182683c6685f2648b5f3c89b90" isn't touched when cleaning cache using your tool or?
I use a local composer repository. So for instance, under src/Namespace/Module
, I have a module and src/*/*
is configured as a local repository. Hence, modules are symlinked into the vendor directory.
When I switch between branches, where a module is only available on one branch, the process crashes with an error like this:
17:02:35 Cleaning cache type(s) block_html full_page
PHP Warning: require(/var/www/my-m2-project/vendor/composer/../namespace/module/registration.php): failed to open stream: No such file or directory in /var/www/my-m2-project/vendor/composer/autoload_real.php on line 70
PHP Fatal error: require(): Failed opening required '/var/www/my-m2-project/vendor/composer/../namespace/module/registration.php' (include_path='/var/www/my-m2-project/vendor/magento/zendframework1/library:.:/usr/share/php:/var/www/my-m2-project/vendor/deployer/recipes:/var/www/my-m2-project/vendor/jalogut/magento2-deployer-plus') in /var/www/my-m2-project/vendor/composer/autoload_real.php on line 70
child_process.js:660
throw err;
^
Error: Command failed: php -r "require '/var/www/my-m2-project/vendor/autoload.php'; \$bp = strlen(dirname(dirname(realpath('/var/www/my-m2-project/vendor/autoload.php')))) + 1; foreach ((new \Magento\Framework\Component\ComponentRegistrar)->getPaths('module') as \$m) echo substr(\$m, \$bp).PHP_EOL;"
PHP Warning: require(/var/www/my-m2-project/vendor/composer/../namespace/module/registration.php): failed to open stream: No such file or directory in /var/www/my-m2-project/vendor/composer/autoload_real.php on line 70
PHP Fatal error: require(): Failed opening required '/var/www/my-m2-project/vendor/composer/../namespace/module/registration.php' (include_path='/var/www/my-m2-project/vendor/magento/zendframework1/library:.:/usr/share/php:/var/www/my-m2-project/vendor/deployer/recipes:/var/www/my-m2-project/vendor/jalogut/magento2-deployer-plus') in /var/www/my-m2-project/vendor/composer/autoload_real.php on line 70
at checkExecSyncError (child_process.js:621:11)
at Object.execSync (child_process.js:657:15)
at aj (/var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:361:138)
at Function.e [as a] (/var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:161:192)
at ij (/var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:363:426)
at Ml (/var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:440:368)
at /var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:441:73
at /var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:363:592
at /var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:361:421
at FSWatcher.<anonymous> (/var/www/my-m2-project/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:345:209) {
status: 255,
signal: null,
output: [
null,
<Buffer 0a 57 61 72 6e 69 6e 67 3a 20 72 65 71 75 69 72 65 28 2f 76 61 72 2f 77 77 77 2f 73 75 6e 6c 69 6e 65 72 2d 6d 32 2f 76 65 6e 64 6f 72 2f 63 6f 6d 70 ... 587 more bytes>,
<Buffer 50 48 50 20 57 61 72 6e 69 6e 67 3a 20 20 72 65 71 75 69 72 65 28 2f 76 61 72 2f 77 77 77 2f 73 75 6e 6c 69 6e 65 72 2d 6d 32 2f 76 65 6e 64 6f 72 2f ... 595 more bytes>
],
pid: 24117,
stdout: <Buffer 0a 57 61 72 6e 69 6e 67 3a 20 72 65 71 75 69 72 65 28 2f 76 61 72 2f 77 77 77 2f 73 75 6e 6c 69 6e 65 72 2d 6d 32 2f 76 65 6e 64 6f 72 2f 63 6f 6d 70 ... 587 more bytes>,
stderr: <Buffer 50 48 50 20 57 61 72 6e 69 6e 67 3a 20 20 72 65 71 75 69 72 65 28 2f 76 61 72 2f 77 77 77 2f 73 75 6e 6c 69 6e 65 72 2d 6d 32 2f 76 65 6e 64 6f 72 2f ... 595 more bytes>
}
Process finished with exit code 1
Could you have a look at that?
Thanks a lot!
How i can clear varnish. Do you plan support it with hotkey "v" for example for clean varnish
We use JeroenBoersma/docker-compose-development
When starting the cache-cleaner, this is what I get;
$ vendor/bin/cache-clean.js --watch
Release 0.0.35 sponsored by https://www.mage2.tv
PHP Parse error: syntax error, unexpected end of file in Command line code on line 1
[ERROR] Command failed: php -r "require '/home/peterjaap/development/workspace/client/magento2/vendor/autoload.php'; foreach ((new \Magento\Framework\Component\ComponentRegistrar)->getPaths('module') as \$m) echo \$m.PHP_EOL;"
PHP Parse error: syntax error, unexpected end of file in Command line code on line 1
I guess this is because the absolute path isn't correct because PHP runs in a Docker container. The valid path in the container is /data/client/magento2/....
.
I tried this;
$ vendor/bin/cache-clean.js --directory /data/client/magento2 --watch
Release 0.0.35 sponsored by https://www.mage2.tv
[ERROR] The Magento directory "/data/client/magento2" does not exist
But that errors out because the directory doesn't exist on the local system. I tried symlinking it, but it gives the same error (it probably checks for a directory and a symlink doesn't count).
When I copy the actual dir to that location on my local machine and run this, it doesn't work either;
$ vendor/bin/cache-clean.js --directory /data/client/magento2 --watch
PHP Parse error: syntax error, unexpected end of file in Command line code on line 1
[ERROR] Command failed: php -r "require '/data/client/magento2/vendor/autoload.php'; foreach ((new \Magento\Framework\Component\ComponentRegistrar)->getPaths('module') as \$m) echo \$m.PHP_EOL;"
PHP Parse error: syntax error, unexpected end of file in Command line code on line 1
I thought that might work because the script checks that the directory exists but then actually looks in the /home/peterjaap/development/workspace/client/magento2
dir through the container.
So we may have a few options to work around this;
Thoughts?
It clears block_html + full_page when I can
<var name="nav">thumbs</var> <!-- Gallery navigation style (false/thumbs/dots) -->
to
dots
but I don't see an effect.
Clearing all caches helps :)
When the file var/cache-clean-config.json
is present, the watcher reads the available modules and themes from it.
When a new module is added and the dump file is recreated, then the watcher should pick up the change without having to be restarted.
I m running this in windowns environment and Magento2.2.7 instance so the issue is when try to change in Ui component listing xml file it trigger to remove specific id cache but when i refresh browser it doesn't actually remove cache i have to remove cache using magento command every time.
Here is how it run.
http://prntscr.com/n4hd3r
I've used magento-cache-clean for Magento Commerce 2.3.2 and it works like a charm. I've used it as a composer repo in my project and as a test also as a composer global repo. Awesome!
When I want to use it for a Magento Commerce 2.3.3 project my watcher output stays the same as 2.3.2 like 'Cleaning cache type(s) block_html full_page' but the cache is not cleared and it seems that it does not work.
Someone else who has an error / bug like this?
Magento 2.3, cache-clean.js
0.3.37, German locale configured, Luma theme active, all caches active, cache-clean.js
running with --watch
option.
Create file vendor/magento/theme-frontend-luma/i18n/de_DE.csv
and add the following:
"Be the first to review this product","Be the first to review this product Custom"
cache-clean.js
flushes the translate
cache type.
Expected result: New translation visible on product page. Actual result: Old translation still visible on product page.
Even if I enter f
to clean the full_page
cache, the old translation is still visible.
Even if I enter t
to clean the translate
cache manually, the old translation is still visible.
It turns out that the t
does not clean the translate
cache correctly. In my case, the file var/cache/mage--e/mage---aaf_TRANSLATE_DE_DE_FRONTEND_DEFAULT_MAGENTO_LUMA_
is not deleted. If I call bin/magento cache:clean translate
, the file is deleted correctly.
Apart from this issue, would it make sense to clean the full_page
cache automatically when a translation is changed?
Hi,
This tool works really great when running it with vendor/bin/cache-clean.js --watch
Now I installed it globally with composer: composer global require mage2tv/magento-cache-clean
File changes are seen by the watcher as it gives output. Sadly the displayed caches are not cleared. Is this something that can be supported?
I was changing
app/code/Example/Foo/etc/webapi.xml
and no cache clean was triggered. Is that correct ?
Sometimes I catch this error.
I use dockerize https://github.com/arvatoSCM/dockerize-magento2
vendor/bin/cache-clean.js --watch
....
Cleaning cache type(s) config
fs.js:941
binding.lstat(pathModule._makeLong(path));
^
Error: ENOENT: no such file or directory, lstat '/home/om3r/Work/dockerize-magento2/vendor/yyy/xxx/.git/index.lock'
at Object.fs.lstatSync (fs.js:941:11)
at Ch (/home/om3r/Work/dockerize-magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:319:85)
at d (/home/om3r/Work/dockerize-magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:323:45)
at FSWatcher.<anonymous> (/home/om3r/Work/dockerize-magento2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:322:138)
at emitTwo (events.js:126:13)
at FSWatcher.emit (events.js:214:7)
at FSEvent.FSWatcher._handle.onchange (fs.js:1364:12)
Since one of the latest versions, it works on my machine as well (fedora).
The tool works great, thanks for that!
When editing app/etc/config.php
, the config cache doesn't get flushed. I tried creating a PR, but wasn't sure enough if my suggestion would do it, next to the fact that I can't build the application 😞.
Anyway, is there a certain reason app/etc/config.php
doesn't flush the config cache? And if it could actually be added, can this be considered as a feature request? 🙃
Would it make sense to add something like this to clear knockout translations?
https://gist.github.com/kolaente/d7c78f0b7b1ebc61f48e32856447ab75#knockout
Static Content deploy was not needed in my case
Hey,
the watcher crashes right after the start. Maybe my node version is too old?
node --version .. v8.11.4
[ERROR] b.setRawMode is not a function
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] cache:watch: ./magento/vendor/bin/cache-clean.js -w -d ./magento/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] cache:watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Regards
Marcus
Flush FPC when requirejs-config.js is removed within pub/static so it will be regenerated.
How about [G] to remove generated/ folder?
Not yet fully reproducible...
Do you know anything about that?
For example it seems to happen when deleting lots of files, moving stuff around and/or composer reinstalling ...
Hey Vinai,
I've a problem with your module. The cache is not cleaned as it should. The output of your module is correct. The cache to be cleaned should be "config". After your module finds the change the message "Cleaning cache type(s) config" appears but the cache is not clean. When i run "./bin/magento cache:clean config" .. it works. Any ideas?
Command & Output
./magento/vendor/bin/cache-clean.js -v -w -d ./magento/
Sponsored by https://www.mage2.tv
Magento dir ./magento/
Watcher initialized (Ctrl-C to quit)
Processing /srv/http/xxx/magento/vendor/xxx/xxx/view/adminhtml/ui_component/xxx_order_grid.xml
Cleaning cache type(s) config
Change in file
<column name="filename">
<settings>
<label translate="true">Filename</label>
<filter>text</filter>
</settings>
</column>
->
<column name="filename">
<settings>
<label translate="true">Filename</label>
<filter>text</filter>
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
</settings>
</column>
Config
'cache' => [
'frontend' => [
'default' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => '127.0.0.1',
'database' => '0',
'port' => '6379'
]
],
'page_cache' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => '127.0.0.1',
'database' => '1',
'port' => '6379',
'compress_data' => '0'
]
]
]
]
Thx
Marcus
Possible improvement:
When schema.graphqls is updated, the config should be cleared.
When developing using docker for mac
, the watcher doesn't not notice changes from host. However, if we change a file inside the container, the watcher notices it right away.
18.06.0-ce-mac70
2.2.5
docker-compose exec phpfpm vendor/bin/cache-clean.js --watch
.phtml
fileNOTE: If you need, I can provide the docker-compose.yml
file or help you to reproduce it.
Watcher notices the change and clears caches
Nothing happens. Even using verbose output, nothing is happening. The watcher does not notice the changes.
NOTE: It works if we edit the file directly inside the container
The following error happened after commenting a die()
line in a front end controllet execute() method, but it's happening in a regular basis after saving anything.
> a:{if(N.b(".php",Fd(a,Q(a)-4))&&(r(Kh(a))?(b=Buffer.alloc(2048),a=Dh.openSync(a,"r"),Dh.readSync(a,b,0,2048,0),Dh.closeSync(a),b=x.a(b)):b=null,a=C(D(Yf(/^\s*namespace\s+([a-z0-9\\]+)/mi,x.a(b)))),b=C(D(Yf(/^\s*class\s+(\w+)/mi,x.a(b)))),a=r(r(a)?b:a)?["\\",x.a(a),"\\",x.a(b)].join(""):null,a=r(a)?wk(a):null,L(a))){de(Bi,"Removing generated code",ze(", ",Z.b(Jk,a)));a=pg(Nh,a);break a}a=null}return a}return null}
> ^
>
> TypeError: Buffer.alloc is not a function
> at Kk (/Users/martins/www/magenteiro2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:420:53)
> at /Users/martins/www/magenteiro2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:421:198
> at FSWatcher.<anonymous> (/Users/martins/www/magenteiro2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:334:138)
> at emitTwo (events.js:100:13)
> at FSWatcher.emit (events.js:185:7)
> at FSEvent.FSWatcher._handle.onchange (fs.js:1300:12)
Video: https://www.youtube.com/watch?v=TfPskiLwy-w
Magento version: 2.3.0
Step to reproduce:
Expected result:
Clean layout full_page_cache, as it would happen if I edit the file above.
Hey,
when I make changes in the menu.xml only the "config" cache is cleaned. To see my change I need to clean the "block_html" cache as well.
Regards
Marcus
Hello,
I am trying to run the tool on windows Git Bash :
vendor/bin/cache-clean.js config full_page
but in result I have this error :
[ERROR] Command failed: php -r 'echo json_encode((require "D:\projects\example\magento/app/etc/env.php") ?? []);'
Looks like there a problem with slash. When I run this command
php -r 'echo json_encode((require "D:/projects/example/magento/app/etc/env.php") ?? []);'
I am getting correct results.
Is it possible to get some fix for hat? Thanks in advance.
Feature request:
add cleaning of the config cache when app/etc/env.php
changes
Hey
amenk suggested the hotkeys in #9 and it's really helpful. Lately I often have to clear the static content in order to get things to work and it would be awesome if there could be a hotkey function to clear var/view_preprocessed/
pub/static/frontend/
pub/static/adminhtml/
Maybe [s]tatic content would be an idea.
If my test is correct, the config cache is not cleared when the file catalog_attributes.xml
is generated or changed. This would probably make sense, right?
Would be cool to have hotkeys like
b -> clean block HTML
f -> clean FPC
and so on, while the watcher is running
Don't know why, but npm wouldn't install (cd vendor/magetv2/mage-cache-clean && npm install
)with just the package-lock.json.
When a new extension attribute is defined or the type of an existing extension attribute is changed, the generated extension attributes class needs to be deleted (e.g. Magento\Catalog\Api\Data\ProductExtension
).
Ideally the watcher would determine the type that needs to be deleted and remove only that one class, but that would require parsing and diffing, and I think that's more effort than it's worth.
Probably it's more stable and fast enough to simply remove all generated *Extension
classes in generated/code
when an extension_attributes.xml
file is changed.
When using the watcher and making changes to system.xml
, it should clean the config
cache.
Steps to reproduce:
system.xml
fileExpected result:
Config cache is cleaned.
Actual result:
No cache is cleaned.
My redis wasn't up and running but cc.js tried to clean parts in redis which resulted in the following error message:
Watcher initialized (Ctrl-C to quit)
Cleaning cache type(s) config
events.js:183
throw er; // Unhandled 'error' event
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
This is a follow-up of #35.
If I change a translation, the translate
cache is cleaned, which totally makes sense. However, in most cases, I still do not see the updated translation, because the full_page
cache is not cleared and still includes the old translation. Would it make sense to clean the full_page
cache as well whenever a translation changes?
Hi Vinai, thanks a lot for the wonderful tool!
As a developer, I want to understand when cache cleaning happened during watch mode.
So I'll be able to make a decision if my latest changes were applied and identify if in some cases a cache wasn't cleaned, so I could report these issues.
Please add timestamp at the start of a row in the CLI output.
Thanks.
Implement cleaning of specific static content when files are changed.
First, .less
file changes can trigger removal of the obsolete copy of the .less
file in var/view_preprocessed
and the generated .css
files in pub/static
.
The second type of static files that could automatically be removed when a file is changed are the js-translation.json
files. The browser local storage still would need to be cleaned manually, but at least the server side would be taken care of automatically.
Related: Issue #15.
Hey,
email_templates.xml changes should trigger config cleaning.
Regards
Marcus
Hi
cache-clean -w doesn't clean cache but it says the cache cleaned
Watcher initialized (Ctrl-C to quit)
Cleaning cache type(s) layout full_page
When pressing a it flushes all the caches and it works
Other options like [c]onfig [b]lock_html [l]ayout [t]ranslate [f]ull_page [v]iew
doesn't work
Installed node v10.16.3
Ubuntu 18.04
I came to know that when i change any record(delete/insert) in any module it doesn't reflect on frontend untill i remove collections
cache.
Is this bug or not related to cache-clean.js?
I m using windows OS :)
v0.0.33
Cleaning cache type(s) config
Cleaning cache type(s) config
Cleaning cache type(s) full_page
fs.js:941
binding.lstat(pathModule._makeLong(path));
^
Error: ENOENT: no such file or directory, lstat '/home/amk/local-workspace/shop.example.com/vendor/degdigital/magento2-customreports/.git/index.lock'
at Object.fs.lstatSync (fs.js:941:11)
at Rh (/home/amk/.composer/global/mage2tv/magento-cache-clean/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:331:167)
at d (/home/amk/.composer/global/mage2tv/magento-cache-clean/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:335:45)
at FSWatcher.<anonymous> (/home/amk/.composer/global/mage2tv/magento-cache-clean/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:334:138)
at emitTwo (events.js:126:13)
at FSWatcher.emit (events.js:214:7)
at FSEvent.FSWatcher._handle.onchange (fs.js:1364:12)
Process finished with exit code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.