emptygif
Idioma: Español

Todos los lenguajes y frameworks

Caddy Caddyfile

Un fragmento en Caddyfile para Caddy que responde a las peticiones a /pixel.gif con el GIF vacío, decodificado una sola vez al arrancar.

Caddy Caddyfile

Archivo
Caddyfile
Ejecutar
caddy run
# respond can't emit binary, so serve a file. Write it once:
#   printf '%b' '\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff\x00\x00\x00\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b' > /srv/pixel.gif
:8080 {
    handle /pixel.gif {
        root * /srv
        rewrite * /pixel.gif
        header Cache-Control "no-store"
        file_server
    }
}

Ejecutamos este fragmento y comparamos los bytes que devolvió.

Comprobar

curl -sI http://localhost:8080/pixel.gif

Sitio oficial: Caddy