Reputation: 4418
I have a situation that IE is caching the Ajax request. I am able to fix the Issue my specially saying response.addHeader("Cache-Control", "no-cache");
in my Servlet. I see that this statementresponse.setHeader("Cache-Control", "no-cache");
also do the same thing. Which is the best method should i us?
Upvotes: 1
Views: 390
Reputation: 12196
Use response.setHeader("Cache-Control", "no-cache");
as that is the only value you want the header to have. addHeader(String, String)
is used when the header can have multiple values assigned to it.
Upvotes: 2