emptygif
言語: 日本語

すべての言語・フレームワーク

Apache HTTP Server Apache config

/pixel.gif へのリクエストに空の GIF を返す、Apache HTTP Server 用の Apache config スニペット。GIF は起動時に一度だけデコードします。

Apache HTTP Server Apache config

ファイル
pixel.conf
実行
apachectl graceful
# 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>

このスニペットは実行し、返されたバイト列を照合しました。

確認

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

公式サイト: Apache HTTP Server