plumber R
A R snippet for plumber that answers requests for /pixel.gif with the empty GIF, decoded once at startup.
plumber R
# plumber.R
gif <- jsonlite::base64_dec("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
#* @get /pixel.gif
#* @serializer contentType list(type = "image/gif")
function(res) {
res$setHeader("Cache-Control", "no-store")
gif
}
We ran this snippet and compared the bytes it returned.
Check it
curl -sI http://localhost:8080/pixel.gif