Laravel PHP
/pixel.gif 요청에 빈 GIF로 응답하는 Laravel용 PHP 스니펫입니다. GIF는 시작할 때 한 번만 디코딩합니다.
Laravel PHP
<?php
// routes/web.php
use Illuminate\Support\Facades\Route;
Route::get('/pixel.gif', function () {
$gif = base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
return response($gif, 200, [
'Content-Type' => 'image/gif',
'Content-Length' => strlen($gif),
'Cache-Control' => 'no-store',
]);
});
이 스니펫은 실행해 보고, 반환된 바이트를 비교했습니다.
확인
curl -sI http://localhost:8080/pixel.gif