如果我将响应 header 设置为
,我会得到一个奇怪的行为response.setHeader("dispatcher", "no-cache");
它不起作用,但我将文本更改为除调度程序之外的任何其他东西,它起作用......有什么想法吗?
这里的响应没有设置为调度程序...为什么?
最佳答案
来自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 是一个负载平衡器,这意味着它位于多台服务器前面并处理传入流量。当您将标题设置为:
response.setHeader("dispatcher", "no-cache");
然后调度程序将删除 header 并转发响应而不缓存。因此,如果“它不起作用”意味着您的 header 正在消失,那么这是预期的行为。
关于java - 为什么将响应 header 设置为调度程序不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30324592/