Hi,
I would like to displya PDF on webview element on the formview.
The PDF files are stored in IBM i's IFS, under LongRange Resource folders.
When the PDF is displayed in the LongRange app,I want that the current version of the PDF is shown. If the target PDF has been deleted since last displayed, I would like to show no PDF. I don't want to use local cashe to show PDFs.
How could it be done in LongRange?
Is tehre any setting or property to be used?
I appreciate your kind advice.
Best Regards,
Megumi Sawada
[RPG]No cache for PDF in webview element
-
MegumiSawada
- Posts: 268
- Joined: Tue Feb 19, 2013 5:18 pm
Re: [RPG]No cache for PDF in webview element
Please try to set the Cache-Control header to "no-cache" for pdf file. This should work.
-
MegumiSawada
- Posts: 268
- Joined: Tue Feb 19, 2013 5:18 pm
Re: [RPG]No cache for PDF in webview element
Hi Jason,
Do you mean I need to set Cache-Control header to "no-cache" for PDF file itself?
I don't know how to do it...
Could you please let me know how to?
Best Regards,
Megumi
Do you mean I need to set Cache-Control header to "no-cache" for PDF file itself?
I don't know how to do it...
Could you please let me know how to?
Best Regards,
Megumi
Re: [RPG]No cache for PDF in webview element
Hi Megumi,
Another way is to set the CachePolicy property of Webview, below is an example for your reference.
It works only for current URL set for webview, if the pdf file is navigated from another page, the system will still cache it.
If this property doesn't satisfy your needs, you have to set the Cache-Control header on server, if so, I will show you how to do it.
Another way is to set the CachePolicy property of Webview, below is an example for your reference.
Code: Select all
#COM_OWNER.set Property('/Form.Fields.Webview1.url') To("http://10.2.1.101/test.pdf")
#COM_OWNER.set Property('/Form.Fields.Webview1.CachePolicy') To("nocache")
If this property doesn't satisfy your needs, you have to set the Cache-Control header on server, if so, I will show you how to do it.