Lahat ng language at framework
Kemal Crystal
Isang Crystal snippet para sa Kemal na sumasagot sa mga request sa /pixel.gif gamit ang empty GIF, na isang beses lang dine-decode sa startup.
Kemal Crystal
require "base64"
require "kemal"
GIF = Base64.decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
get "/pixel.gif" do |env|
env.response.content_type = "image/gif"
env.response.headers["Cache-Control"] = "no-store"
env.response.write(GIF) # write the bytes; a non-String return value is ignored
nil
end
Kemal.run(8080)
Sinuri batay sa kasalukuyang dokumentasyon ng framework.
Suriin
curl -sI http://localhost:8080/pixel.gif