pushya
pushya

Reputation: 4418

IE caching the ajax request

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

Answers (1)

Dev
Dev

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

Related Questions