-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileDownloader: Dynamically generated files not generated in Firefox due to caching #10909
Comments
I do it exactly like in the example under "LAZILY DETERMINE THE CONTENT AND THE NAME OF THE FILE BEING SERVER" on https://vaadin.com/docs/v8/framework/articles/LettingTheUserDownloadAFile.html. But when I'm in my Firefox and click the second time (see description above), the overriden method handleConnectorRequest isn't any more called and therefore there is no chance to change the filename. Therefore I assume, that it has to do something with caching. But how to force the browser not to cache in this case? |
I have the same problem ( Vaadin 7 ). |
Have you tried with |
yes, in my case |
Great! Thanks for the hint. This works! |
Hi, thanks for you answer, please you can can share part of your code, still have the problem I, do this, it's correct? |
I literally just called the setCacheTime(0) method, nothing much else. Here is some code:
And generateCsvDataFile() talks to backend process to construct a CSV:
Maybe you are having another issue. This issue seems to only happen with Firefox, and is easily repeatable - every single time in a single session it will get the same file you downloaded the first time. It was rather consistent. The above code so far has NOT broken the other browsers, but in my case it actually makes sense to turn off caching anyway. Hope that helps. |
I'm using the Vaadin FileDownloader.
When clicking on the corresponding button for the first time, Firefox caches the downloaded file. If I'm not refreshing the screen, the second time the browser doesn't contact FileDownloader anymore but immediately offers the cached file.
The files I'm downloading are dynamically generated before download - so I need an option to switch off this browser behaviour.
I've found this link: https://stackoverflow.com/questions/12331993/how-to-disable-browser-caching-in-vaadin?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa ...
... but how can I do this with FileDownloader?
The text was updated successfully, but these errors were encountered: