IIS Compression Module and Vary: Accept-Encoding Header

后端 未结 2 1884
情话喂你
情话喂你 2021-02-15 16:17

Is there a way to change the IIS compression module so that it does not put in Vary: Accept-Encoding in the Response Headers? I would rather it put in Vary: * or do nothing and

2条回答
  •  礼貌的吻别
    2021-02-15 17:21

    Ok, apparently the IIS compression module forces the Vary header to be Accept-Encoding no matter what, so caching becomes tricky. For pages with authentication this is bad, because it will not detect that it's different based on the user cookie. I ended up rolling my own compression in my controller and everything works fine now.

    My suggestion- only use IIS static compression, don't use dynamic compression and instead roll your own dynamic compression. It will save you pain in the long run and give you more control.

提交回复
热议问题