Plans for a Shiny Book?

I would really appreciate a book on how to use applying standard web tools/approaches to Shiny development.

One of the best pieces of advice I got on how to improve Shiny loading times, courtesy of @jcheng, was to use a CDN to speed up the loading of a large javascript dependency. The large dependency meant that my app loading time took anywhere between 1s-45s.

To diagnose the issue we used Chrome developer tools -> Network tab to identify any slow loading assets. Then to fix it we inserted the following into the UI file.

htmltools::htmlDependency("viz", "99",
src = c(href = "https://cdn.rawgit.com/rich-iannone/DiagrammeR/master/inst/htmlwidgets/lib/viz/"),
script = "viz.js")

Joe's explanation of why this works - "This will cause viz.js to be loaded from a CDN instead of your Shiny Server. Because it's being served from a static site, it should be cacheable by the browser--it may be equally slow the first time loading but hopefully after that you should get much faster load times."

5 Likes