At first, caching didn't work in all browsers. Then I made it work in all browsers but IE (IE8) by adding .pdf extension to the url. Servlet stopped being called after that.
I display pdf file inline on the webpage via EMBED tag that loads the following url:
http://localhost:7001/app/viewFile.pdf
Which is generated by java servlet with the following headers:
response.addHeader("Content-Disposition", "inline;");
response.setHeader("Cache-control", "cache,max-age=600");
response.setContentType(mimeType);
response.setContentLength(contentLength);
For pdf displaying in all browsers I use Adobe Reader 9.2.0.
How to make it work in IE too? I noticed that IE adds 'Cache-Control: no-cache' header to request, whereas Safari, for example, doesn't.