Skip to content

Commit e603554

Browse files
committed
Update the web app manifest file related configs
The specification for the manifest file for web applications was recently updated¹ and it changed one of the recommended file extensions from `.manifest` to the unique `.webmanifest`². "`.manifest` was the recommended file extension for the Application Cache manifest file, and then, it was changed³ to `.appcache` in order to "avoid clashing with Microsoft's unregistered `application/manifest` type". So, taking into consideration also the legacy aspects, recommending `.manifest` as the file extension creates even more "clashing", and this can complicate things when it comes to server configs (e.g.: especially as in some of the cases, things like the media type matter). ... It's not only about "sending the recommended mime type". Some servers (e.g.: Apache) rely on the media type for different settings (e.g: ExpiresByType), and not having a unique file extension sometimes makes the mapping to a media type not so straightforward. " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ¹ w3c/manifest@0eecadd ² w3c/manifest#346 ³ https://html5.org/r/5812
1 parent 3133baa commit e603554

14 files changed

+167
-141
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### HEAD
2+
3+
* Update the web app manifest file related configs.
4+
15
### 2.13.0 (March 4, 2015)
26

37
* Remove the mapping of `.manifest` files to the `text/cache-manifest` media type

dist/.htaccess

+23-37
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Options -MultiViews
130130
# the `X-UA-Compatible` response header should be send only for
131131
# HTML documents and not for the other resources.
132132

133-
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
133+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
134134
Header unset X-UA-Compatible
135135
</FilesMatch>
136136

@@ -185,37 +185,7 @@ Options -MultiViews
185185

186186
# Manifest files
187187

188-
# If you are providing a web application manifest file (see
189-
# the specification: https://w3c.github.io/manifest/), it is
190-
# recommended that you serve it with the `application/manifest+json`
191-
# media type.
192-
#
193-
# Because the web application manifest file doesn't have its
194-
# own unique file extension, you can set its media type either
195-
# by matching:
196-
#
197-
# 1) the exact location of the file (this can be done using a
198-
# directive such as `<Location>`, but it will NOT work in
199-
# the `.htaccess` file, so you will have to do it in the main
200-
# server configuration file or inside of a `<VirtualHost>`
201-
# container)
202-
#
203-
# e.g.:
204-
#
205-
# <Location "/.well-known/manifest.json">
206-
# AddType application/manifest+json json
207-
# </Location>
208-
#
209-
# 2) the filename (this can be problematic as you will need to
210-
# ensure that you don't have any other file with the same name
211-
# as the one you gave to your web application manifest file)
212-
#
213-
# e.g.:
214-
#
215-
# <Files "manifest.json">
216-
# AddType application/manifest+json json
217-
# </Files>
218-
188+
AddType application/manifest+json webmanifest
219189
AddType application/x-web-app-manifest+json webapp
220190
AddType text/cache-manifest appcache
221191

@@ -297,11 +267,13 @@ AddDefaultCharset utf-8
297267
.js \
298268
.json \
299269
.jsonld \
270+
.manifest \
300271
.rdf \
301272
.rss \
302273
.topojson \
303274
.vtt \
304275
.webapp \
276+
.webmanifest \
305277
.xloc \
306278
.xml
307279
</IfModule>
@@ -475,7 +447,7 @@ AddDefaultCharset utf-8
475447
# # the `X-Frame-Options` response header should be send only for
476448
# # HTML documents and not for the other resources.
477449

478-
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
450+
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
479451
# Header unset X-Frame-Options
480452
# </FilesMatch>
481453

@@ -510,7 +482,7 @@ AddDefaultCharset utf-8
510482
# # the `Content-Security-Policy` response header should be send
511483
# # only for HTML documents and not for the other resources.
512484

513-
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
485+
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
514486
# Header unset Content-Security-Policy
515487
# </FilesMatch>
516488

@@ -678,7 +650,7 @@ AddDefaultCharset utf-8
678650
# # the `X-XSS-Protection` response header should be send only for
679651
# # HTML documents and not for the other resources.
680652

681-
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
653+
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
682654
# Header unset X-XSS-Protection
683655
# </FilesMatch>
684656

@@ -878,9 +850,12 @@ FileETag None
878850
ExpiresDefault "access plus 1 month"
879851

880852
# CSS
853+
881854
ExpiresByType text/css "access plus 1 year"
882855

856+
883857
# Data interchange
858+
884859
ExpiresByType application/atom+xml "access plus 1 hour"
885860
ExpiresByType application/rdf+xml "access plus 1 hour"
886861
ExpiresByType application/rss+xml "access plus 1 hour"
@@ -892,25 +867,33 @@ FileETag None
892867
ExpiresByType application/xml "access plus 0 seconds"
893868
ExpiresByType text/xml "access plus 0 seconds"
894869

870+
895871
# Favicon (cannot be renamed!) and cursor images
872+
896873
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
897874
ExpiresByType image/x-icon "access plus 1 week"
898875

899876
# HTML
877+
900878
ExpiresByType text/html "access plus 0 seconds"
901879

880+
902881
# JavaScript
882+
903883
ExpiresByType application/javascript "access plus 1 year"
904884
ExpiresByType application/x-javascript "access plus 1 year"
905885
ExpiresByType text/javascript "access plus 1 year"
906886

887+
907888
# Manifest files
908-
ExpiresByType application/manifest+json "access plus 1 year"
909889

890+
ExpiresByType application/manifest+json "access plus 1 week"
910891
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
911892
ExpiresByType text/cache-manifest "access plus 0 seconds"
912893

894+
913895
# Media files
896+
914897
ExpiresByType audio/ogg "access plus 1 month"
915898
ExpiresByType image/bmp "access plus 1 month"
916899
ExpiresByType image/gif "access plus 1 month"
@@ -922,6 +905,7 @@ FileETag None
922905
ExpiresByType video/ogg "access plus 1 month"
923906
ExpiresByType video/webm "access plus 1 month"
924907

908+
925909
# Web fonts
926910

927911
# Embedded OpenType (EOT)
@@ -942,7 +926,9 @@ FileETag None
942926
# Web Open Font Format (WOFF) 2.0
943927
ExpiresByType application/font-woff2 "access plus 1 month"
944928

929+
945930
# Other
931+
946932
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
947933

948934
</IfModule>
@@ -994,5 +980,5 @@ FileETag None
994980
# <IfModule mod_rewrite.c>
995981
# RewriteEngine On
996982
# RewriteCond %{REQUEST_FILENAME} !-f
997-
# RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp)$ $1.$3 [L]
983+
# RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
998984
# </IfModule>

src/internet_explorer/x-ua-compatible.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# the `X-UA-Compatible` response header should be send only for
2424
# HTML documents and not for the other resources.
2525

26-
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
26+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
2727
Header unset X-UA-Compatible
2828
</FilesMatch>
2929

src/media_types/character_encodings.conf

+2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ AddDefaultCharset utf-8
2424
.js \
2525
.json \
2626
.jsonld \
27+
.manifest \
2728
.rdf \
2829
.rss \
2930
.topojson \
3031
.vtt \
3132
.webapp \
33+
.webmanifest \
3234
.xloc \
3335
.xml
3436
</IfModule>

src/media_types/media_types.conf

+1-31
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,7 @@
2929

3030
# Manifest files
3131

32-
# If you are providing a web application manifest file (see
33-
# the specification: https://w3c.github.io/manifest/), it is
34-
# recommended that you serve it with the `application/manifest+json`
35-
# media type.
36-
#
37-
# Because the web application manifest file doesn't have its
38-
# own unique file extension, you can set its media type either
39-
# by matching:
40-
#
41-
# 1) the exact location of the file (this can be done using a
42-
# directive such as `<Location>`, but it will NOT work in
43-
# the `.htaccess` file, so you will have to do it in the main
44-
# server configuration file or inside of a `<VirtualHost>`
45-
# container)
46-
#
47-
# e.g.:
48-
#
49-
# <Location "/.well-known/manifest.json">
50-
# AddType application/manifest+json json
51-
# </Location>
52-
#
53-
# 2) the filename (this can be problematic as you will need to
54-
# ensure that you don't have any other file with the same name
55-
# as the one you gave to your web application manifest file)
56-
#
57-
# e.g.:
58-
#
59-
# <Files "manifest.json">
60-
# AddType application/manifest+json json
61-
# </Files>
62-
32+
AddType application/manifest+json webmanifest
6333
AddType application/x-web-app-manifest+json webapp
6434
AddType text/cache-manifest appcache
6535

src/security/content-security-policy.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# the `Content-Security-Policy` response header should be send
2828
# only for HTML documents and not for the other resources.
2929

30-
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
30+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
3131
Header unset Content-Security-Policy
3232
</FilesMatch>
3333

src/security/x-frame-option.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# the `X-Frame-Options` response header should be send only for
4141
# HTML documents and not for the other resources.
4242

43-
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
43+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
4444
Header unset X-Frame-Options
4545
</FilesMatch>
4646

src/security/x-xss-protection.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# the `X-XSS-Protection` response header should be send only for
4444
# HTML documents and not for the other resources.
4545

46-
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
46+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
4747
Header unset X-XSS-Protection
4848
</FilesMatch>
4949

src/web_performance/expires_headers.conf

+15-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
ExpiresDefault "access plus 1 month"
1717

1818
# CSS
19+
1920
ExpiresByType text/css "access plus 1 year"
2021

22+
2123
# Data interchange
24+
2225
ExpiresByType application/atom+xml "access plus 1 hour"
2326
ExpiresByType application/rdf+xml "access plus 1 hour"
2427
ExpiresByType application/rss+xml "access plus 1 hour"
@@ -30,25 +33,33 @@
3033
ExpiresByType application/xml "access plus 0 seconds"
3134
ExpiresByType text/xml "access plus 0 seconds"
3235

36+
3337
# Favicon (cannot be renamed!) and cursor images
38+
3439
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
3540
ExpiresByType image/x-icon "access plus 1 week"
3641

3742
# HTML
43+
3844
ExpiresByType text/html "access plus 0 seconds"
3945

46+
4047
# JavaScript
48+
4149
ExpiresByType application/javascript "access plus 1 year"
4250
ExpiresByType application/x-javascript "access plus 1 year"
4351
ExpiresByType text/javascript "access plus 1 year"
4452

53+
4554
# Manifest files
46-
ExpiresByType application/manifest+json "access plus 1 year"
4755

56+
ExpiresByType application/manifest+json "access plus 1 week"
4857
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
4958
ExpiresByType text/cache-manifest "access plus 0 seconds"
5059

60+
5161
# Media files
62+
5263
ExpiresByType audio/ogg "access plus 1 month"
5364
ExpiresByType image/bmp "access plus 1 month"
5465
ExpiresByType image/gif "access plus 1 month"
@@ -60,6 +71,7 @@
6071
ExpiresByType video/ogg "access plus 1 month"
6172
ExpiresByType video/webm "access plus 1 month"
6273

74+
6375
# Web fonts
6476

6577
# Embedded OpenType (EOT)
@@ -80,7 +92,9 @@
8092
# Web Open Font Format (WOFF) 2.0
8193
ExpiresByType application/font-woff2 "access plus 1 month"
8294

95+
8396
# Other
97+
8498
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
8599

86100
</IfModule>

src/web_performance/filename-based_cache_busting.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
<IfModule mod_rewrite.c>
1414
RewriteEngine On
1515
RewriteCond %{REQUEST_FILENAME} !-f
16-
RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp)$ $1.$3 [L]
16+
RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
1717
</IfModule>

0 commit comments

Comments
 (0)