Serving compressed *.data file with Cloudflare Pages

62 views Asked by At

I'm trialing using Cloudflare Pages to deploy a WebAssembly game. The game has a single *.data file that contains all the game assets (images, music, etc). Cloudflare Pages does not seem to serve a compressed version of this file (despite a compressed gzip or Brotli version being significantly smaller - nearly 50% of the uncompressed file size). I'm guessing it's because CloudFlare will only return GZIP or Brotli-encoded responses for the following content types (See here):

text/html
text/richtext
text/plain
text/css
text/x-script
text/x-component
text/x-java-source
text/x-markdown
application/javascript
application/x-javascript
text/javascript
text/js
image/x-icon
image/vnd.microsoft.icon
application/x-perl
application/x-httpd-cgi
text/xml
application/xml
application/rss+xml
application/vnd.api+json
application/x-protobuf
application/json
multipart/bag
multipart/mixed
application/xhtml+xml
font/ttf
font/otf
font/x-woff
image/svg+xml
application/vnd.ms-fontobject
application/ttf
application/x-ttf
application/otf
application/x-otf
application/truetype
application/opentype
application/x-opentype
application/font-woff
application/eot
application/font
application/font-sfnt
application/wasm
application/javascript-binast
application/manifest+json
application/ld+json
application/graphql+json
application/geo+json

Is there any way to get Cloudflare to serve a compressed version of the file if supported by visitors’ web browser?

Cloudflares website mentions:

Enterprise customers can use Compression Rules to override Cloudflare’s default compression behavior.

But hopefully I'm overlooking something & my simplistic use case can be accomplished on a mere Pro plan?

0

There are 0 answers