![]() |
Prevent Caching??
Is there a way to prevent images (or content) from being cached on a user's computer?
Debbie |
The simplest way to do that if you have access to a server side language is to simply add a header to tell the browser not to cache the file.
|
without getting into setting headers, you can add different GET data each time image is downloaded.
for example if url of image is http://example.com/pic.png, you can access it using http://example.com/pic.png?q=1, http://example.com/pic.png?q=2, http://example.com/pic.png?q=3, and so on. this way each rime you have diferent url, and browser will download image every time |
Quote:
1.) How reliable is that? 2.) Will it work equally well in any Server-side Language (e.g. .Net, PHP, etc.)? 3.) Will it work equally well across Browsers (e.g. Internet Explorer, FireFox, Chrome, etc.)? Thanks, Debbie |
Quote:
Debbie |
If you'll use URL method, most browser will cache images and discard them when you leave page. That's true also for files with no-cache headers (browser need to have images to display them afterall).
Usually purpose of disabling caching is to display several dynapically generated images with the same url on one page and in that case both methods would work. maybe i can give you more speciffic info if you'll tell why you want to prevent caching ;) |
Quote:
Each teacher logs into the Test Bank over a secure connection, writes their assigned Questions/Answers, it is reviewed and approved by a lead, and then the teacher can no longer view the Questions/Answers. My client is worried that if a teacher is writing Test Questions/Answers at school or home, and things get cached in their browser or saved some other way (e.g. temp files on Op Sys), then there is an enormous risk that the Test could get into the wrong hands, which would be catastrophic!!! (It is assumed that teachers are honest and will not save an Web Content or Images themselves.) I know that you have to download a Web page and Web Images to view them, but is there a way to ensure that the minute a user navigate to a new page, or submits a form, or closes their browser that nothing is left behind in the Browser Cache or Temp Files?? Hope that helps, Debbie |
In that case changing URLs won't help you at all i'm afraid.
As fare as I know your only option would be to include headers in all images, HTML documents and everything else you can download as teacher. html: Code:
<meta http-equiv="cache-control" content="no-cache">Code:
header('Cache-Control: no-cache, must-revalidate'); |
| All times are GMT +1. The time now is 07:30 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.