Prevent PDFViewer from saving anything local

1 Answer 26 Views
General Discussions PDFViewer
Tommy
Top achievements
Rank 1
Iron
Iron
Iron
Tommy asked on 25 Jan 2024, 07:42 PM
I would like to ensure that no trace of the PDF is saved to the local machine in any kind of cache etc.
Is this how the PDFViewer works?

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 30 Jan 2024, 03:32 PM

Hi Tommy,

The PDFViewer doesn't require the browser to cache any part of the pdf files that it load and visualizes.

Therefore whether the files are cached or not is in the domain of the browser.

You may find this StackOverflow thread useful where it's discussed how you can configure your pages to instruct the browser not to cache their resources.

I hope the information above is useful.

Regards,
Stoyan
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tommy
Top achievements
Rank 1
Iron
Iron
Iron
commented on 06 Feb 2024, 09:12 PM

Hmmmm so no real reliable way of making the PDFViewer not cache anything locally.
We are trying to ensure that sensitive documents are not stored anywhere in a cache...
Stoyan
Telerik team
commented on 07 Feb 2024, 05:23 PM

Hi Tommy, 

There is a way to make pdf files not cached locally.

One approach is to use the PDFViewer's DPL processing which processes the rendering of the pdf on the server and sent a response a byte array. More information on the configuration is available at the PDFViewer DPL Demo.

Alternatively, you need to ensure a page that contains the PDFViewer isn't cached by the browser. You can achieve this by configuring the following attributes of the Action method responsible for routing:
[HttpGet]
[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
public ActionResult SampleView()
{
    return View("PDFViewerPage");
}
More information on the caching is available at the official Microsoft documentation article about Response Caching.


Please give these options a try and let me know whether they have helped in achieving the desired outcome.
Tags
General Discussions PDFViewer
Asked by
Tommy
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Stoyan
Telerik team
Share this question
or