I found that when I send a request for a html/js/css file. There is no “Content-Length” in response header.
After read this thread: No content-length header when response is compressed
I added Cache-Control: no-transform in the original files’ header.
Then the Content-Length appears but only when there is ‘accept-encoding: gzip’ in request header.
How can I get Content-Length without ‘accept-encoding: gzip’ in request header? Because the code in the client cannot be modified.
==============================
curl -i -X HEAD “xxxxvideoExport.html” -H ‘accept-encoding: gzip’
HTTP/1.1 200 OK
Date: Wed, 15 Jan 2020 13:20:42 GMT
Content-Type: text/html
Content-Length: 5377
Connection: keep-alive
Set-Cookie: __cfduid=d4024a42757617b97d4508f5237884f461579094442; expires=Fri, 14-Feb-20 13:20:42 GMT; path=/; domain=.d5cdncom; HttpOnly; SameSite=Lax
x-oss-request-id: 5E1F11AA61355339307F743B
Accept-Ranges: bytes
ETag: “1350E83369C6635B8CCC25411D531881”
Last-Modified: Wed, 15 Jan 2020 12:05:21 GMT
x-oss-object-type: Normal
x-oss-hash-crc64ecma: 4902218131152636029
x-oss-storage-class: Standard
Content-Encoding: gzip
Cache-Control: no-transform
Content-MD5: E1DoM2nGY1uMzCVBHVMYgQ==
x-oss-server-time: 1
CF-Cache-Status: DYNAMIC
Server: Cloudflare
CF-RAY: 5558260bee897740-LAX
curl -i -X HEAD “xxx/videoExport.html”
HTTP/1.1 200 OK
Date: Wed, 15 Jan 2020 13:23:00 GMT
Content-Type: text/html
Connection: keep-alive
Set-Cookie: __cfduid=d350e3f426e58c9e64aad120baecd26e51579094579; expires=Fri, 14-Feb-20 13:22:59 GMT; path=/; domain=.d5cdncom; HttpOnly; SameSite=Lax
x-oss-request-id: 5E1F12348BA11E3137EB9033
ETag: W/“1350E83369C6635B8CCC25411D531881”
Last-Modified: Wed, 15 Jan 2020 12:05:21 GMT
x-oss-object-type: Normal
x-oss-hash-crc64ecma: 4902218131152636029
x-oss-storage-class: Standard
Cache-Control: no-transform
Content-MD5: E1DoM2nGY1uMzCVBHVMYgQ==
x-oss-server-time: 4
CF-Cache-Status: DYNAMIC
Server: Cloudflare
CF-RAY: 55582963dac0e4e6-LAX