我突然收到來自 Google 圖像代理伺服器的請求,如下所示:
66.249.81.250 - - [04/May/2015:06:55:54 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.93.170 - - [04/May/2015:06:56:31 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.93.170 - - [04/May/2015:06:56:31 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.83.202 - - [04/May/2015:06:56:44 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
64.233.173.224 - - [04/May/2015:06:56:45 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.81.244 - - [04/May/2015:06:56:49 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.83.196 - - [04/May/2015:06:57:19 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
64.233.173.218 - - [04/May/2015:06:57:27 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.83.208 - - [04/May/2015:06:57:30 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.88.250 - - [04/May/2015:06:57:32 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
66.249.88.252 - - [04/May/2015:06:57:32 +0000] "GET /images/image_1.jpg HTTP/1.1" 200 93394 "-" "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
正如您所看到的,我的伺服器(Apache 2.2.22)正在回應完整的 200 並為每個請求重新發送映像。當我在瀏覽器中發出相同的請求時,我收到 304 個回應和以下標頭:
Cache-Control:max-age=5184000
Date:Mon, 04 May 2015 06:43:00 GMT
Expires:Fri, 03 Jul 2015 06:43:00 GMT
是否有某種原因導致 Google 圖像代理不尊重這些,除了打開 Cloudflare 之類的東西並希望得到最好的結果之外,我還能做些什麼嗎?我的理解是從...
Apache 日誌充滿連線 - “(透過 ggpht.com GoogleImageProxy)”
……這是「正常」流量,但我對每次都必須重新提供整個 100kb 檔案感到不高興。
答案1
Goolge 圖像代理程式正在快取。
您可以透過將圖像嵌入電子郵件並將其發送到您可以控制的 Gmail 帳戶來輕鬆測試這一點。
重新載入頁面幾次(當然會刪除快取)。
快取被命中,您的伺服器將不會收到任何請求。
目前還不清楚是否向多個用戶提供相同的快取 URL/檔案。
也許這就是你所看到的。
但無論如何:如果您向 10 個人發送一封電子郵件並在其中嵌入圖像,您應該期望您的伺服器必須處理 10 個請求。
我不明白這怎麼會氾濫成災。