LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Disable caching in HTML (https://www.linuxquestions.org/questions/programming-9/disable-caching-in-html-548685/)

sharathkv 04-24-2007 03:56 PM

Disable caching in HTML
 
Hi,

Is there a way to disable caching programatically in HTML?

I use a lot of HTML pages, and when I type a URL in Internet Explorer, it shows me a lot other HTML pages that have been cached. I don't want these pages to be cached for security reasons.

I need to programatically disable caching of HTML pages on the client machine where these pages will be accessed.

Thanks

slantoflight 04-24-2007 04:17 PM

Wait you mean to say you're concerned about security or privacy? And you're using Internet Explorer? Whew, good luck on that.
I don't remember the link, but I'm remember reading article on clearing Internet Explorer history and it looked like a real pain. Attempting to clear it manually could probably take a good 5 minutes out your life.

And to make things worse...
This is just the stuff the author knew about.
In actuality who knows how deep within the system the history is buried. Internet Explorer is integrated tightly with Windows.

I wish you the best, really I do. But it looks like a lost cause for Internet Destroyer.

I recommend Firefox or actually any browser thats NOT Internet Explorer. Or better yet, take DSL on small usb stick with you whenever you plan on going on public computers.

sharathkv 04-24-2007 04:47 PM

I tried this & it's not working :confused:
Code:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

I'm not in a position to decide who will use which browser & why. Right now all I need to know is how to disable caching in IE? :study: and make it work.:)

Thanks

AdaHacker 04-24-2007 09:09 PM

Quote:

Originally Posted by sharathkv
I use a lot of HTML pages, and when I type a URL in Internet Explorer, it shows me a lot other HTML pages that have been cached. I don't want these pages to be cached for security reasons.

That's not caching, that's the browser history. It also has less than nothing to do with HTML. You need to find the appropriate setting for your browser (and no, I don't know what that is). It's impossible to change that through HTML.

slantoflight 04-24-2007 09:16 PM

Quote:

Originally Posted by sharathkv
I tried this & it's not working :confused:
Code:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

I'm not in a position to decide who will use which browser & why. Right now all I need to know is how to disable caching in IE? :study: and make it work.:)

Thanks

Then I misinterpreted your goal then. But now its looks like I'm going to be even more confused. You want to somehow disable local browser-caching from the server side somehow?
If user information being leaked somehow from cached html pages is the concern.. you could use server-side scripting to generate html interfaces. That way the page cached is nearly useless locally. All that would be left is some cached images and a completely broken interface.

However some further research shows a microsoft recommend way.

http://support.microsoft.com/kb/q222064/


And another way thats more along the lines of my thinking.

http://www.pacificnet.net/~johnr/meta.html

Sadly though, not all the rules are not necessarily followed and browsers, particularly Internet Explorer, are known to do their own thing. So it looks like CGI is the only way to make it bullet.
It could be very tedious. But basically your (cached) html page would end up looking like this.

<html>
<form METHOD="GET">
bunch of cryptic of calls that result html being displayed
calls that are only valid for a specific amount of time from a specific ip

</form>

And on your server side...

Check ip of client.
accept strange cryptic cgi calls that produce html interfaces for x period of time
from that specific host

But NATs could potentially break this. So you're left with cookies. And since cookies can be manipulated you're back to square one. And even if they didn't, a caching proxy could still ruin you, especially if the proxy was somehow able to freeze cookies in time.

Unfortunately it basically looks like theres no hope at all.
:(

Unless you use https perhaps. Would save some trouble. You'll notice typing https://anypage
reveals that atleast https pages are'nt cached.


All times are GMT -5. The time now is 03:54 AM.