Cache-Control Header Modified By PHP Session?

后端 未结 2 445
慢半拍i
慢半拍i 2020-12-25 08:29

I\'m outputting an image to the browser using a Zend_Controller_Response object. It is my intention to apply caching to the image, however something is causing

2条回答
  •  遥遥无期
    2020-12-25 08:54

    From the Zend_Controller documentation, section 10.9. The Response Object

    setHeader($name, $value, $replace = false) is used to set an individual header. By default, it does not replace existing headers of the same name in the object; however, setting $replace to true will force it to do so.

    The problem you are having is your max-age=3600 is being appended to the cache-control header, as opposed to replacing it. Try setting the $replace parameter to true.

提交回复
热议问题