Skip to content

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

src/files_match_pattern

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ txt
4545
vcard
4646
vcf
4747
vtt
48+
wasm
4849
webapp
4950
web[mp]
5051
webmanifest

src/media_types/media_types.conf

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
AddType image/x-icon cur ico
5454

5555

56+
# WebAssembly
57+
58+
AddType application/wasm wasm
59+
60+
5661
# Web fonts
5762

5863
AddType font/woff woff

src/web_performance/compression.conf

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"application/schema+json" \
3131
"application/vnd.geo+json" \
3232
"application/vnd.ms-fontobject" \
33+
"application/wasm" \
3334
"application/x-font-ttf" \
3435
"application/x-javascript" \
3536
"application/x-web-app-manifest+json" \

src/web_performance/expires_headers.conf

+5
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
ExpiresByType video/webm "access plus 1 month"
7979

8080

81+
# WebAssembly
82+
83+
ExpiresByType application/wasm "access plus 1 year"
84+
85+
8186
# Web fonts
8287

8388
# Collection

test/fixtures/test.wasm

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#define WASM_EXPORT __attribute__((visibility("default")))
2+
3+
WASM_EXPORT
4+
int test(int n) {
5+
return n;
6+
}

test/tests.js

+7
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,13 @@ exports = module.exports = {
485485
}
486486
},
487487

488+
'test.wasm': {
489+
responseHeaders: {
490+
'cache-control': 'max-age=31536000, no-transform',
491+
'content-type': 'application/wasm'
492+
}
493+
},
494+
488495
'test.webapp': {
489496
responseHeaders: {
490497
'cache-control': 'max-age=0, no-transform',

0 commit comments

Comments
 (0)