Skip to content

getCurrentOutputInfo() should be more cache aware #3208

@cpsievert

Description

@cpsievert

(Continuation of #3198 (comment))

Currently bindCache() doesn't consider getCurrentOutputInfo() when computing cache keys, but it probably should (especially considering that thematic implicitly calls it at plot time). For a minimal example of the suprising behavior it can lead to, run this app once to warm the cache), then change fg = "white" to fg = "red" notice how the fg of the plot remains unchanged (it should be red not white)

library(shiny)

shinyOptions(cache = cachem::cache_disk("./myapp-cache"))

ui <- fluidPage(
  theme = bslib::bs_theme(bg = "black", fg = "white"),
  "True foreground color",
  plotOutput("p")
)

server <- function(input, output, session) {
  output$p <- renderPlot(plot(1:10)) %>%
    bindCache()
}
thematic::thematic_shiny()
shinyApp(ui, server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions