Skip to content

Commit

Permalink
Add WebAssembly module MIME type
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb committed Apr 16, 2018
1 parent 4c5a962 commit a2e7d7b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/files_match_pattern
Expand Up @@ -45,6 +45,7 @@ txt
vcard
vcf
vtt
wasm
webapp
web[mp]
webmanifest
Expand Down
5 changes: 5 additions & 0 deletions src/media_types/media_types.conf
Expand Up @@ -53,6 +53,11 @@
AddType image/x-icon cur ico


# WebAssembly

AddType application/wasm wasm


# Web fonts

AddType font/woff woff
Expand Down
1 change: 1 addition & 0 deletions src/web_performance/compression.conf
Expand Up @@ -30,6 +30,7 @@
"application/schema+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/wasm" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
Expand Down
5 changes: 5 additions & 0 deletions src/web_performance/expires_headers.conf
Expand Up @@ -78,6 +78,11 @@
ExpiresByType video/webm "access plus 1 month"


# WebAssembly

ExpiresByType application/wasm "access plus 1 year"


# Web fonts

# Collection
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/test.wasm
@@ -0,0 +1,6 @@
#define WASM_EXPORT __attribute__((visibility("default")))

WASM_EXPORT
int test(int n) {
return n;
}
7 changes: 7 additions & 0 deletions test/tests.js
Expand Up @@ -485,6 +485,13 @@ exports = module.exports = {
}
},

'test.wasm': {
responseHeaders: {
'cache-control': 'max-age=31536000, no-transform',
'content-type': 'application/wasm'
}
},

'test.webapp': {
responseHeaders: {
'cache-control': 'max-age=0, no-transform',
Expand Down

0 comments on commit a2e7d7b

Please sign in to comment.