3

I'm not sure if this applies to every Android phone, but it seems that many Android browsers don't cache the Apple Touch Icon and reload it on every page view.

I have the following in the <head> of my HTML pages:

<link rel="apple-touch-icon" sizes="152x152" href="/path/to/icon.jpg" />

In my server logs, I see many visitors from Android clients that keep requesting the icon file on every single page view:

[02/Jan/2014:16:21:43 +0100] "GET /path/to/icon.jpg HTTP/1.1" 200 13017 "-" "Mozilla/5.0 (Linux; U; Android 4.1.2; de-de; GT-I9100 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
[02/Jan/2014:16:22:04 +0100] "GET /path/to/icon.jpg HTTP/1.1" 200 13017 "-" "Mozilla/5.0 (Linux; U; Android 4.1.2; de-de; GT-I9100 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
[02/Jan/2014:16:22:30 +0100] "GET /path/to/icon.jpg HTTP/1.1" 200 13017 "-" "Mozilla/5.0 (Linux; U; Android 4.1.2; de-de; GT-I9100 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
[02/Jan/2014:16:22:45 +0100] "GET /path/to/icon.jpg HTTP/1.1" 200 13017 "-" "Mozilla/5.0 (Linux; U; Android 4.1.2; de-de; GT-I9100 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
[02/Jan/2014:16:23:03 +0100] "GET /path/to/icon.jpg HTTP/1.1" 200 13017 "-" "Mozilla/5.0 (Linux; U; Android 4.1.2; de-de; GT-I9100 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"

I've seen this with Android versions 4.1, 4.2, and 4.3. My server sends an Expires header, so caching should work fine:

$ date -u
Thu Jan  2 15:28:49 UTC 2014
$ curl -s -D - www.mywebsite.com/path/to/icon.jpg -o /dev/null
HTTP/1.1 200 OK
Date: Thu, 02 Jan 2014 15:28:52 GMT
Server: Apache/2.2.16 (Debian)
Last-Modified: Mon, 30 Dec 2013 14:04:44 GMT
ETag: "15201cd-316b-4eec0ecfd5700"
Accept-Ranges: bytes
Content-Length: 12651
Cache-Control: max-age=900
Expires: Thu, 02 Jan 2014 15:43:52 GMT
Content-Type: image/jpeg

These clients also cache CSS and other files successfully.

Has anyone seen this before? What's the reason? Is it simply an Android browser bug?

nwellnhof
  • 225
  • 1
  • 2
  • 8

0 Answers0