CF Pages: Can I pre-compress a file to provide a Content-Length header?

As taken from https://community.cloudflare.com/t/no-content-length-header-when-content-type-gzip/492964/2 it appears Content-Length is generally unavailable for cloudflare pages objects as they are transparently compressed and delievered without knowing the final size of the content. I have a rather large WASM file that I'm wanting to display a loading bar for as it is downloaded to a browser from cloudflare pages. While I could likely (?) solve this by disabling compression for the file, the savings from compressing it are quite significant. Is it possible that I could precompress the file with brotli and provide the headers like so? _headers
myfile.wasm.br
Content-Type: application/wasm
Content-Encoding: br
Content-Length: <size_of_brotli_file>
myfile.wasm.br
Content-Type: application/wasm
Content-Encoding: br
Content-Length: <size_of_brotli_file>
If I do this-- will I get a Content-Length response for that file from Cloudflare Pages? Thanks!
1 Reply
Xangelix
XangelixOP3mo ago
Oops~! Moving this to #pages-help
Want results from more Discord servers?
Add your server