Todos los lenguajes y frameworks
Apache HTTP Server Apache config
Un fragmento en Apache config para Apache HTTP Server que responde a las peticiones a /pixel.gif con el GIF vacío, decodificado una sola vez al arrancar.
Apache HTTP Server Apache config
# Write the file 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' > /var/www/pixel.gif
# Needs mod_alias, mod_mime and mod_headers.
Alias "/pixel.gif" "/var/www/pixel.gif"
<Location "/pixel.gif">
Require all granted
ForceType image/gif
Header set Cache-Control "no-store"
</Location>
Ejecutamos este fragmento y comparamos los bytes que devolvió.
Comprobar
curl -sI http://localhost:8080/pixel.gif