Todas as linguagens e frameworks
Apache HTTP Server Apache config
Um snippet em Apache config para Apache HTTP Server que responde às requisições para /pixel.gif com o GIF vazio, decodificado uma única vez na inicialização.
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>
Executamos este snippet e comparamos os bytes que ele retornou.
Verificar
curl -sI http://localhost:8080/pixel.gif