Sinatra Ruby
A Ruby snippet for Sinatra that answers requests for /pixel.gif with the empty GIF, decoded once at startup.
Sinatra Ruby
require "sinatra"
GIF = "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==".unpack1("m0").freeze
set :port, 8080
get "/pixel.gif" do
content_type :gif
cache_control :no_store
GIF
end
We ran this snippet and compared the bytes it returned.
Check it
curl -sI http://localhost:8080/pixel.gif