# GitHub uses HTTP caching for all raw files.
url <- paste0(
"https://raw.githubusercontent.com/allisonhorst/palmerpenguins/",
"master/inst/extdata/penguins.csv"
)
# Here I set debug = TRUE so you can see what's happening
req <- request(url) |> req_cache(tempdir(), debug = TRUE)
# First request downloads the data
resp <- req |> req_perform()
# Second request retrieves it from the cache
resp <- req |> req_perform()
Run the code above in your browser using DataLab