Xangelix
Explore posts from serversCDCloudflare Developers
•Created by Xangelix on 9/19/2024 in #pages-help
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
If I do this-- will I get a Content-Length response for that file from Cloudflare Pages? Thanks!2 replies
CDCloudflare Developers
•Created by Xangelix on 9/19/2024 in #general-help
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
If I do this-- will I get a Content-Length response for that file from Cloudflare Pages? Thanks!2 replies