Skip to content

Commit 0ba37cb

Browse files
committed
Add configs for image/vnd.microsoft.icon
By default the configurations from this repository ensure that `.ico` files are served with the `image/x-icon`¹ media type, compressed, and with far future expires headers. However, not all users use all the configurations provided by this project, or in some cases, the headers are overwritten from the level "beneath" Apache (e.g.: from `php`). Looking at the results from the HTTP Archive² from 15.10.2014: +----+--------------------+---------------------------------+ | | number of requests | media type | +----+--------------------+---------------------------------+ | 1 | 7406888 | image/jpeg | | | ... | ... | * | 10 | 342964 | image/x-icon | | | ... | ... | * | 17 | 85390 | image/vnd.microsoft.icon | | | ... | ... | +----+--------------------+---------------------------------+ it's not surprising to see that the IANA registered³ `image/vnd.mimetype.icon` media type is also used quite often. Other incorrect/unofficial media types are also used, but their usage is either wrong or low enough to not justify their addition. +----+--------------------+---------------------------------+ | | number of requests | media type | +----+--------------------+---------------------------------+ | 1 | 342964 | image/x-icon | | 2 | 98936 | text/html | | 3 | 85390 | image/vnd.microsoft.icon | | | ... | ... | | 9 | 652 | image/x-ico | | 10 | 446 | image/ico | | | ... | ... | | 15 | 102 | image/icon | | | ... | ... | | 17 | 94 | image/xicon | | 18 | 82 | application/x-icon | | | ... | ... | +----+--------------------+---------------------------------+ Because of the things stated above, the changes from this commit will ensure that Apache will serve anything labeled with the `image/vnd.microsoft.icon` compressed and with far future expires headers. - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - ¹ h5bp/html5-boilerplate@37b5fec http://blogs.msdn.com/b/ieinternals/archive/2011/02/11/ie9-release-candidate-minor-changes-list.aspx ² https://www.igvita.com/2013/06/20/http-archive-bigquery-web-performance-answers/ Query used for the first table: select count(requestid) as number_of_requests, mimetype as media_type from [httparchive:runs.2014_10_15_requests] group by media_type order by number_of_requests desc; Query used for the second table: select count(requestid) as number_of_requests, mimetype as media_type from [httparchive:runs.2014_10_15_requests] where (lower(mimetype) contains "ico") or ( regexp_match(lower(url), r'\.ico$') or regexp_match(lower(url), r'.ico\?') ) group by media_type order by number_of_requests desc; ³ http://www.iana.org/assignments/media-types/image/vnd.microsoft.icon
1 parent f00b864 commit 0ba37cb

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### HEAD
22

3+
* Add configs for files marked as `image/vnd.microsoft.icon`.
34
* Add configs for files marked as `font/eot`.
45

56
### 2.10.0 (October 20, 2014)

dist/.htaccess

+2
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ AddDefaultCharset utf-8
723723
"font/opentype" \
724724
"image/bmp" \
725725
"image/svg+xml" \
726+
"image/vnd.microsoft.icon" \
726727
"image/x-icon" \
727728
"text/cache-manifest" \
728729
"text/css" \
@@ -829,6 +830,7 @@ FileETag None
829830
ExpiresByType text/xml "access plus 0 seconds"
830831

831832
# Favicon (cannot be renamed!) and cursor images
833+
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
832834
ExpiresByType image/x-icon "access plus 1 week"
833835

834836
# HTML

src/web_performance/compression.conf

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"font/opentype" \
4646
"image/bmp" \
4747
"image/svg+xml" \
48+
"image/vnd.microsoft.icon" \
4849
"image/x-icon" \
4950
"text/cache-manifest" \
5051
"text/css" \

src/web_performance/expires_headers.conf

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
ExpiresByType text/xml "access plus 0 seconds"
3232

3333
# Favicon (cannot be renamed!) and cursor images
34+
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
3435
ExpiresByType image/x-icon "access plus 1 week"
3536

3637
# HTML

test/fixtures/.htaccess

+2
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ AddDefaultCharset utf-8
675675
"font/opentype" \
676676
"image/bmp" \
677677
"image/svg+xml" \
678+
"image/vnd.microsoft.icon" \
678679
"image/x-icon" \
679680
"text/cache-manifest" \
680681
"text/css" \
@@ -781,6 +782,7 @@ FileETag None
781782
ExpiresByType text/xml "access plus 0 seconds"
782783

783784
# Favicon (cannot be renamed!) and cursor images
785+
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
784786
ExpiresByType image/x-icon "access plus 1 week"
785787

786788
# HTML

0 commit comments

Comments
 (0)