Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
stream document being cached
Hi,
I am having problem of the document stream being cached even though I am providing these properties for the stream source.Are there any other parameters I need to set?
resource.getStream().setParameter("Cache-Control","private,no-cache,no-store");
resource.getStream().setCacheTime(0);
resource.setMIMEType("application/pdf");
Quick response is much appreciated.
Thanks,
I don't quite know why the cache settings do not work or if there are ones that do, but this is a known problem. A workaround is to change the filename each time the document is reloaded. See the makeImageFilename() method and how it is used in this example.