为什么将响应 header 设置为调度程序不起作用

Why setting response header as dispatcher not working

如果我将响应 header 设置为

,我会出现奇怪的行为
response.setHeader("dispatcher", "no-cache"); 

它不工作,但我将文本更改为除调度程序以外的任何其他东西它工作...有什么想法吗?

这里的response没有设置为dispatcher...为什么?

来自 Adobe documentation 多处引用:

With the Dispatcher release 4.0.0 (and higher) a new header named "Dispatcher: no-cache" is introduced. This header informs the dispatcher not to cache the response. This header will then be removed by the dispatcher before forwarding the response to the client.

Adobe Dispatcher 是一个负载平衡器,这意味着它位于您的多个服务器前面并处理传入流量。当您将 header 设置为:

response.setHeader("dispatcher", "no-cache");

然后 Dispatcher 将 删除 header 并在不缓存的情况下转发响应。因此,如果 "It is not working" 你的意思是你的 header 正在消失,那么这是预期的行为。