| Author |
How to clear the browser cache when I close my browser.
|
Ratish Vichithran
Greenhorn
Joined: Feb 27, 2009
Posts: 9
|
|
My application shows payslips of employees. So when a user click on a link it generates the pdf for which I have added the following code,
But the problem here is that, it creates a PDF in the temporary folder.
Is there a way to delete the cache after the browser showing the pdf is closed?
I tried deactivating cache with the following code,
but it gave me an error saying the file could not be downloaded.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
|
Nope. The file must be copied to the local system in order to be viewed and there is no setting to cause it to delete itself.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ratish Vichithran
Greenhorn
Joined: Feb 27, 2009
Posts: 9
|
|
Hi Bear Bibeault. Thanks for the reply...
But is there any way to avoid a Cache and also show a pdf using Content-Disposition as inline? . Because it is a security concern. Any other user using the work station can easily access the previous persons data.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
|
Nope. It is the responsibility of the user to keep his data secure.
|
 |
Ratish Vichithran
Greenhorn
Joined: Feb 27, 2009
Posts: 9
|
|
Ok let me put it this way. How will I show a pdf to the user and also adhere to security?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
Let me put it this way: you can't!
If you want to show the file to the user, it must be downloaded to their system. After that, it's their responsibility.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
Alternatives:
Don't use a PDF or anything that needs to be downloaded to their system. Just show it as a no-cached page.Explore password-protecting the PDF.Don't show it in the broswer at all; send it in email.
|
 |
 |
|
|
subject: How to clear the browser cache when I close my browser.
|
|
|