Modified PDF won't refresh inside Brower control [message #1456448] |
Thu, 30 October 2014 11:23 |
|
We use PDFBox library to create PDF files within our RAP application, but if I overwrite a PDF file, it does not get refreshed in any Browser control that points to it. It doesn't seem to matter what I do with the Browser control - I can even dispose it and recreate it, but pointing the new Browser to that same URL does not pick up the new modified PDF - it must cache the original one somewhere.
The only way to get a refreshed view is to start a brand new session in RAP.
How are RWT-Resources cached? Is there a way to force RAP to notice the changed file and reload?
It is not a browser issue - the same behaviour occurs on Firefox, Chrome and IE, and even on Firefox where there is an option to reload frame, it still uses the cached version.
Whose cache is it? I don't believe it is the browser - the behaviour indicates a RAP/RWT cache. Perhaps it is cached at the time when the RWT-Resource is registered?
Thanks, John
---
Just because you can doesn't mean you should
|
|
|
|
|
Re: Modified PDF won't refresh inside Brower control [message #1456605 is a reply to message #1456478] |
Thu, 30 October 2014 14:31 |
|
Thanks Ivan and Roland for your comments... they got me thinking...
I'm using ResourceManager.register(<filename>, <stream>) to register the PDF file as rwt-resource, but I assumed that the resource simply pointed to the physical file, but it appears not. The RWT resource is cached at the time the register is done, so if the physical file changes after that time, the resource will never know about it.
I also made an (incorrect) assumption that you didn't need to re-register a modified file on that basis, but I've changed this now, so that every time I re-create the PDF file, I register it again, with the same name through the ResourceManager, and now the modified PDF is picked up OK.
So, that was my misunderstanding of how RWT resources worked, and when they are cached.
If you change the file, re-register it!
All works now thanks guys!
John
---
Just because you can doesn't mean you should
|
|
|
Powered by
FUDForum. Page generated in 0.03904 seconds