Skip to content

Commit 6dae5d4

Browse files
committed
Add configs for files marked as font/eot
By default the configurations from this repository ensure that `.eot` files are served with the `application/vnd.ms-fontobject` 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 | 683558 | font/eot | | | ... | ... | * | 17 | 176674 | application/vnd.ms-fontobject | | | ... | ... | +----+--------------------+---------------------------------+ it's clear that the `font/eot` media type is used way more often than the IANA registered² `application/vnd.ms-fontobject`. 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 | 683558 | font/eot | | 2 | 176674 | application/vnd.ms-fontobject | | | ... | ... | | 6 | 9950 | text/html | | 7 | 1062 | x-font/eot | | | ... | ... | | 10 | 400 | application/vnd.bw-fontobject | | | ... | ... | | 15 | 86 | application/x-font-eot | | | ... | ... | | 17 | 44 | application/font-eot | | | ... | ... | +----+--------------------+---------------------------------+ Because of the things stated above, the changes from this commit will ensure that Apache will serve anything labeled with the `font/eot` compressed and with far future expires headers. - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - ¹ 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 "eot") or (lower(mimetype) contains "vnd.ms-fontobject") or ( regexp_match(lower(url), r'\.eot$') or regexp_match(lower(url), r'.eot\?') ) group by media_type order by number_of_requests desc; ² http://www.iana.org/assignments/media-types/application/vnd.ms-fontobject
1 parent 1e1bc1e commit 6dae5d4

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### HEAD
2+
3+
* Add configs for files marked as `font/eot`.
4+
15
### 2.10.0 (October 20, 2014)
26

37
* Add `bower.json` and publish on `Bower`

dist/.htaccess

+3
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ AddDefaultCharset utf-8
703703
"application/x-web-app-manifest+json" \
704704
"application/xhtml+xml" \
705705
"application/xml" \
706+
"font/eot" \
706707
"font/opentype" \
707708
"image/bmp" \
708709
"image/svg+xml" \
@@ -717,6 +718,7 @@ AddDefaultCharset utf-8
717718
"text/vtt" \
718719
"text/x-component" \
719720
"text/xml"
721+
720722
</IfModule>
721723

722724
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -842,6 +844,7 @@ FileETag None
842844
ExpiresByType application/font-woff2 "access plus 1 month"
843845
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
844846
ExpiresByType application/x-font-ttf "access plus 1 month"
847+
ExpiresByType font/eot "access plus 1 month"
845848
ExpiresByType font/opentype "access plus 1 month"
846849
ExpiresByType image/svg+xml "access plus 1 month"
847850

src/web_performance/compression.conf

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"application/x-web-app-manifest+json" \
4242
"application/xhtml+xml" \
4343
"application/xml" \
44+
"font/eot" \
4445
"font/opentype" \
4546
"image/bmp" \
4647
"image/svg+xml" \
@@ -55,6 +56,7 @@
5556
"text/vtt" \
5657
"text/x-component" \
5758
"text/xml"
59+
5860
</IfModule>
5961

6062
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

src/web_performance/expires_headers.conf

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
ExpiresByType application/font-woff2 "access plus 1 month"
6363
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
6464
ExpiresByType application/x-font-ttf "access plus 1 month"
65+
ExpiresByType font/eot "access plus 1 month"
6566
ExpiresByType font/opentype "access plus 1 month"
6667
ExpiresByType image/svg+xml "access plus 1 month"
6768

test/fixtures/.htaccess

+3
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ AddDefaultCharset utf-8
655655
"application/x-web-app-manifest+json" \
656656
"application/xhtml+xml" \
657657
"application/xml" \
658+
"font/eot" \
658659
"font/opentype" \
659660
"image/bmp" \
660661
"image/svg+xml" \
@@ -669,6 +670,7 @@ AddDefaultCharset utf-8
669670
"text/vtt" \
670671
"text/x-component" \
671672
"text/xml"
673+
672674
</IfModule>
673675

674676
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -794,6 +796,7 @@ FileETag None
794796
ExpiresByType application/font-woff2 "access plus 1 month"
795797
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
796798
ExpiresByType application/x-font-ttf "access plus 1 month"
799+
ExpiresByType font/eot "access plus 1 month"
797800
ExpiresByType font/opentype "access plus 1 month"
798801
ExpiresByType image/svg+xml "access plus 1 month"
799802

0 commit comments

Comments
 (0)