Lahat ng language at framework
plumber R
Isang R snippet para sa plumber na sumasagot sa mga request sa /pixel.gif gamit ang empty GIF, na isang beses lang dine-decode sa 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
}
Pinatakbo namin ang snippet na ito at ikinumpara ang mga byte na ibinalik nito.
Suriin
curl -sI http://localhost:8080/pixel.gif