From 6dae5d4e063db5d70a3a7abecadb97707b6fdf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Mari=C8=99?= Date: Sat, 25 Oct 2014 18:33:11 +0300 Subject: [PATCH] Add configs for files marked as `font/eot` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CHANGELOG.md | 4 ++++ dist/.htaccess | 3 +++ src/web_performance/compression.conf | 2 ++ src/web_performance/expires_headers.conf | 1 + test/fixtures/.htaccess | 3 +++ 5 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8116d1..cd810e27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### HEAD + +* Add configs for files marked as `font/eot`. + ### 2.10.0 (October 20, 2014) * Add `bower.json` and publish on `Bower` diff --git a/dist/.htaccess b/dist/.htaccess index f8cdfc58..6970d213 100644 --- a/dist/.htaccess +++ b/dist/.htaccess @@ -703,6 +703,7 @@ AddDefaultCharset utf-8 "application/x-web-app-manifest+json" \ "application/xhtml+xml" \ "application/xml" \ + "font/eot" \ "font/opentype" \ "image/bmp" \ "image/svg+xml" \ @@ -717,6 +718,7 @@ AddDefaultCharset utf-8 "text/vtt" \ "text/x-component" \ "text/xml" + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -842,6 +844,7 @@ FileETag None ExpiresByType application/font-woff2 "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" ExpiresByType application/x-font-ttf "access plus 1 month" + ExpiresByType font/eot "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" diff --git a/src/web_performance/compression.conf b/src/web_performance/compression.conf index 61d2e414..746924f0 100644 --- a/src/web_performance/compression.conf +++ b/src/web_performance/compression.conf @@ -41,6 +41,7 @@ "application/x-web-app-manifest+json" \ "application/xhtml+xml" \ "application/xml" \ + "font/eot" \ "font/opentype" \ "image/bmp" \ "image/svg+xml" \ @@ -55,6 +56,7 @@ "text/vtt" \ "text/x-component" \ "text/xml" + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/web_performance/expires_headers.conf b/src/web_performance/expires_headers.conf index 1b94e98b..c84b905b 100644 --- a/src/web_performance/expires_headers.conf +++ b/src/web_performance/expires_headers.conf @@ -62,6 +62,7 @@ ExpiresByType application/font-woff2 "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" ExpiresByType application/x-font-ttf "access plus 1 month" + ExpiresByType font/eot "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" diff --git a/test/fixtures/.htaccess b/test/fixtures/.htaccess index e62425f1..b61e11b4 100644 --- a/test/fixtures/.htaccess +++ b/test/fixtures/.htaccess @@ -655,6 +655,7 @@ AddDefaultCharset utf-8 "application/x-web-app-manifest+json" \ "application/xhtml+xml" \ "application/xml" \ + "font/eot" \ "font/opentype" \ "image/bmp" \ "image/svg+xml" \ @@ -669,6 +670,7 @@ AddDefaultCharset utf-8 "text/vtt" \ "text/x-component" \ "text/xml" + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -794,6 +796,7 @@ FileETag None ExpiresByType application/font-woff2 "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" ExpiresByType application/x-font-ttf "access plus 1 month" + ExpiresByType font/eot "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month"