Having a strange issue with Commandbox Docker imag...
# box-products
g
Having a strange issue with Commandbox Docker image. For some reason, it is caching .js, .txt, similar files. Switched to the lucee image and problem went away.
b
@Grant Shepert I assume you're in production profile
Enable the file system watcher to have the cache automatically invalidated on file change
Or disable the cache
The cache is disabled by default for non-production profiles
Copy code
server set web.fileCache.enable=false
g
cool, tks, will try that. haven’t changed anything in … what, 3 years, so bit of a mystery why it’s suddenly happening.
b
Or if you like the cache and just want it to update automatically,
Copy code
server set runwar.args='--resource-manager-file-system-watcher=true'
The cache is an undertow feature that was activated a few versions ago in CommandBox
It caches small files in memory for super fast serving
I had the file watcher enabled by default, but it caused issues when people had like 50k+ files in their web root
So now the file system watcher is off by default so the cache won't clear automatically any longer
g
Got it, thanks for the insights.
j
@Grant Shepert What I typically do, so that the directory watcher doesn’t have to do anything, is set the following. Disabling
sendfile
does effectively the same thing with big static assets. I run this in development and never have an issue with the files being cached
Copy code
BOX_SERVER_RUNWAR_ARGS=--sendfile-enable false --resource-manager-file-system-watcher false
Or you can place the above in your
server.json
Disabling
sendfile
means the file is always read from the disk and not the buffer/cache
d
You guys are good!