Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
I don't want Browser to cache my web page

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
dude
Power User
Power User


Joined: 10 Mar 2004
Posts: 376
Location: Savar, Dhaka

Post Post subject: I don't want Browser to cache my web page Reply with quote

I don't want Browser to cache my web page. How can I do that? If the browser do caching my website, it does not show the latest version of my website. How can I make it so that the browser no longer cahches my website. But brings the website new everytime a user comes?
Sat Oct 02, 04 2:25 pm
Back to top
dude View user's profile Send private message Visit poster's website
hasnut
Expert User
Expert User


Joined: 28 Aug 2004
Posts: 201

Post Post subject: Reply with quote

in php
Code:
 header("Pragma: no-cache");

in Asp
Code:
<% Response.AddHeader "Pragma", "No-Cache" %>

in html

Code:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

or

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">



IF you need more details on this let me know.

But No-CACHE is generally used on transection related pages.
But for other pages you need to add more info say after 10 days clear cache etc.

If you need more details let me know.
_________________
Sarder Hasnut
MCSD, CIW A

Need Low Cost Prefessional Hosting Contact me
Sat Oct 02, 04 3:27 pm
Back to top
hasnut View user's profile Send private message Visit poster's website MSN Messenger
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: Reply with quote

That's a very useful informastion. But somewhere I heard that <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> does not work in some cases. I will ook that up and post here if I find it.
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Sun Oct 03, 04 12:20 am
Back to top
emm View user's profile Send private message
hasnut
Expert User
Expert User


Joined: 28 Aug 2004
Posts: 201

Post Post subject: Reply with quote

depends on how you used it. Here is the solution

http://support.microsoft.com/default.aspx?scid=kb;EN-US;222064
_________________
Sarder Hasnut
MCSD, CIW A

Need Low Cost Prefessional Hosting Contact me
Sun Oct 03, 04 10:33 am
Back to top
hasnut View user's profile Send private message Visit poster's website MSN Messenger
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: Reply with quote

Yes, that's the one I was thinking.

To properly prevent the Web page from appearing in the cache, place another header section at the end of the HTML document. For example:


<HTML>

<HEAD>



<META HTTP-EQUIV="REFRESH" CONTENT="5">
<TITLE> Pragma No-cache </TITLE>


</HEAD>

<BODY>


This is an example of where to place the second header section<br>
so that the "Pragama, No-Cache" metatag will work as it is supposed to.<br>



</BODY>

<HEAD>


<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">


</HEAD>

</HTML>
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Mon Oct 04, 04 12:07 am
Back to top
emm View user's profile Send private message
dude
Power User
Power User


Joined: 10 Mar 2004
Posts: 376
Location: Savar, Dhaka

Post Post subject: Reply with quote

Thank you both, hasnut and emm. Now I am thinking it may not be a good idea to not allow cache at all. Then even the images will have to be downloaded everytime users come back.
Mon Oct 04, 04 2:28 am
Back to top
dude View user's profile Send private message Visit poster's website
hasnut
Expert User
Expert User


Joined: 28 Aug 2004
Posts: 201

Post Post subject: Reply with quote

dude wrote:
Thank you both, hasnut and emm. Now I am thinking it may not be a good idea to not allow cache at all. Then even the images will have to be downloaded everytime users come back.


Depends, when it comes to transaction through your shopping cart then some portion you should not cache.
_________________
Sarder Hasnut
MCSD, CIW A

Need Low Cost Prefessional Hosting Contact me
Mon Oct 04, 04 2:48 am
Back to top
hasnut View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group