tags:

views:

19

answers:

1

How to disable caching ?

What headers should doGet set?

Could you provide a code snippet?

+3  A: 

This will set caching to disabled on the response:

// Set standard HTTP/1.1 no-cache headers.
response.setHeader("Cache-Control", "private, no-store, no-cache, must-revalidate");

// Set standard HTTP/1.0 no-cache header.
response.setHeader("Pragma", "no-cache");
rsp