title: Is it possible to clear the Shiny cache when reloading an app?
body: <p>Is it possible to clear the Shiny cache history when reloading an app? Specifically, I have a textInput for adding a title that doesn't clear when the app is restarted. In other words, all of the titles entered into the app on previous runs have been &quot;remembered&quot; and show up in a dropdown list when the app is rerun or restarted again. I have tried using shinyjs::reset, but that clears the current value and not the ones in the &quot;history&quot;. I've also tried updateTextInput with an action button set to &quot; &quot;, but also clears only the current value and not the ones in the &quot;history&quot;. I have also tried setting ui as a function using:</p>
  <p>ui &lt;- function(req) {
  fluidPage(...)
  }</p>
  <p>as well as:</p>
  <p>I found that cache of R Shiny server is updated when the date of creation for the file &quot;app.R&quot; is changed.</p>
  <p>So, here is the trick I used:</p>
  <p>server &lt;- function(input, output, session) {</p>
  <p>Trick file date creation update
  onStop(function() {</p>
  <pre><code> # File name
   p &lt;- paste0(getwd(), &quot;/app.R&quot;)
  
   # Update file 'date creation'
   Sys.setFileTime(p, now())
  </code></pre>
  <p>}) # onStop</p>
  <p>} # server
  The idea is to update the date of &quot;app.R&quot; creation after each session.</p>
  <p>Neither of these solutions worked for me. Finally, I found this post:</p>
  <p>I also found this post:</p>
  <p>I have been struggling with this problem for quite a while, and thought I had tried everything, including putting a js button on the shiny sidebar to manually refresh (unfortunately that did not work either). There are two things that did work for me:</p>
  <ol>
  <li><p>Make sure all code to read data from files is NOT in a code chunk with a name OTHER THAN <code>global</code> OR</p>
  </li>
  <li><p>Manually restart the shiny server when new data is uploaded</p>
  </li>
  </ol>
  <p>Obviously the first one is much more manageable, and a solution that I wish I had known weeks ago when I started playing with workarounds.</p>
  <p>But I am not sure what is involved in implementing either, so if someone could clarify that, that would be great.</p>
  <p>Any help would be much appreciated.</p>