Remove shiny cache

shiny
rstudio

#1

Dear community,

I am now deploying a shiny app, but when i relaunch the app, the changes do not apper, and a cached version of the app is displayed.

How can I flush this cache? I have trying everything, like closing Firefox and open in private mode to the url:port, and also closing and reopening Rstudio.

Thanks in advance
Jesús


#2

How do you relaunch? The Shiny Server looks at the timestamp of the main file (app.R or server.R/ui.R) to determine i reload is needed. Just touch these files and Shiny Server will force a reload. Alternatively, restart the server (this is probably only useful in a development setup).

Cheers
Steen


#3

I agree with @stkrog. In my experience, restarting the server is the fastest way to have your app reflects your code change.


#4

What files have you changed when you say you deployed a new app? A not very well known trick is to create a file named restart.txt in the same directory as your ui/server. Whenever this restart.txt file is modified, the app will restart. You can run the command touch restart.txt to do that.


#5

... or just touch app.R :wink:


#6

If you are deploying on Rconnect theres an option at the top of the screen that lets you change the active version of your app. It forces a restart when it changes versions (so you can flip back and forth)

image

(Really useful if your app pulls data from an external source when it starts and you don't want to re-deploy the application or wait hours to refresh the data.)