简体   繁体   中英

Restart chrome browser on Ubuntu 16.04 when starting up Docker container running React

I am working to deploy a docker container that runs a react app that performs a fetch request to another docker container running a node server. Docker is deployed on Ubuntu 16.04 but when I build the container and deploy, the chrome browser will continue to display the old UI until a hard refresh or browser restart is performed.

Is there a way for me to clear the browser cache, hard refresh or restart the browser when the react app starts? I am building the react app with create-react-app .

For reference, I am deploying this app on many machines so doing anything manual on the host machine is not ideal.

Docker caches the results of your first build to make it faster for subsequent builds. You could try this command to clear the cache when you deploy.

docker build --no-cache -t u12_core -f u12_core .

However I think your problem is with the browser cache on chrome.

You could disable cache when DevTools is open. (This option can be found inside Settings -> General)

Alternatively, you could use one of the chrome cache cleaner extensions .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM