Content-length and other HTTP headers?

前端 未结 6 1416
时光取名叫无心
时光取名叫无心 2020-12-05 10:45

Does it give me any advantage if I set this header when generating normal HTML pages?

I see that some frameworks out there will set this header property and I was wo

6条回答
  •  我在风中等你
    2020-12-05 11:26

    I think its only because of the HTTP Spec says to do this in every case possible.

    Applications SHOULD use this field to indicate the transfer-length of the message-body, unless this is prohibited by the rules in section 4.4.

    You can also look at Pauls Answer on the Question of Deaomon.

    I think this will answer yours too.

    Also you should use Content-Length if you want someone download a file with another header: e.g.

    
    

提交回复
热议问题