leaflet() %>%
enableTileCaching() %>%
addTiles(options = tileOptions(useCache = TRUE, crossOrigin = TRUE))
## for more examples see
# browseURL(system.file("examples/TileLayer-Caching.R", package = "leaflet.extras"))
Run the code above in your browser using DataLab