2014-07-16 3 views
1

장치 해상도에 따라 동적으로 크기가 조정 된 이미지를 전달하려면 nginx 및 Adaptive Images을 사용하고 있습니다. adaptive-images.php 파일에 의해 설정된 응답 헤더는 아래에 나와 있지만 브라우저가 페이지를 새로 고칠 때마다 이미지가 다시 요청됩니다. 브라우저가 이러한 이미지를 캐싱하지 않는 이유는 무엇입니까? 브라우저는 Google 크롬이며 요청 헤더에 max-age=0을 설정하는 것처럼 보입니다. F5, Ctrl + F5를 시도하고 주소 표시 줄에 URL을 입력하고 Enter 키를 누릅니다.브라우저가 내 이미지를 캐싱하지 않는 이유는 무엇입니까?

요청 헤더 :

GET /img/photos/p8.jpg HTTP/1.1 
Host: example.com 
Connection: keep-alive 
Cache-Control: max-age=0 
Accept: image/webp,*/*;q=0.8 
Pragma: no-cache 
If-Modified-Since: Wed, 16 Jul 2014 12:01:31 GMT 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36 
Referer: http://example.com/ 
Accept-Encoding: gzip,deflate,sdch 
Accept-Language: en-US,en;q=0.8,en-GB;q=0.6 

응답 헤더 :

HTTP/1.1 200 OK 
Server: nginx 
Date: Wed, 16 Jul 2014 12:08:55 GMT 
Content-Type: image/jpeg 
Content-Length: 391104 
X-Powered-By: PHP/5.4.30 
Cache-Control: private, max-age=604800 
Expires: Wed, 23 Jul 2014 12:08:55 GMT 
Last-Modified: Wed, 16 Jul 2014 12:08:55 GMT 
Connection: Keep-Alive 

답변

관련 문제