prevent ie from caching json responses

This commit is contained in:
Athou
2013-03-28 15:44:27 +01:00
parent b1e9be765b
commit 938ab3c26d

View File

@@ -67,6 +67,8 @@ public class JSONMessageBodyReaderWriter implements MessageBodyWriter<Object>,
WebApplicationException {
httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, mediaType.toString()
+ ";charset=UTF-8");
httpHeaders.putSingle(HttpHeaders.CACHE_CONTROL, "no-cache");
httpHeaders.putSingle("Pragma", "no-cache");
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
getGson().toJson(t, type, writer);
writer.flush();