title: R Shiny: fast reactive image display
body: <p>I'm trying to display images in my shiny app reactively. I've successfully done that in the <strong>server.R</strong> script with:</p>
  
  <pre><code>output$display.image &lt;- renderImage({
  
      image_file &lt;- paste("www/",input$image.type,".jpeg",sep="")
  
      return(list(
        src = image_file,
        filetype = "image/jpeg",
        height = 520,
        width = 696
      ))
  
    }, deleteFile = FALSE)
  </code></pre>
  
  <p>BUT it's <strong>very slow</strong>. </p>
  
  <p>However, it is <strong>VERY fast</strong> to embed one of the images into the <strong>ui.R</strong> script like so:</p>
  
  <pre><code>tabPanel("Live Images", img(src = "img_type1.jpeg"))
  </code></pre>
  
  <p>Why is there such a difference? Is there any way to make the reactive images appear faster?</p>