|  | |  |
04-11-2004, 10:30 AM
|
#1 (permalink)
| | Regular Contributor
Join Date: Feb 2003 Location: indisclosed
Posts: 210
| Ignoring Cache I'm having a bit of trouble with people looking at one of my sites, and complaining about not seeing the recent changes of one of the pages. The problem is that their cache is still holding the page that was their previous to the update.
Is there a way to have it ignore the cache settings, or refresh everytime it's loaded? |
| |
04-11-2004, 10:02 PM
|
#3 (permalink)
| | Regular Contributor
Join Date: Feb 2003 Location: indisclosed
Posts: 210
| Thanx bdl!
Looks like the web host doesn't have the required apache modules added. Oh well. Guess I will have to E-mail the admin, or force root privs.
Isn't there a way to auto-refresh with javascript? Just trying to think of other solutions since the best idea is nixed. |
| |
04-12-2004, 11:05 AM
|
#4 (permalink)
| | Code Monkey
Join Date: Mar 2003 Location: Evansville, IN
Posts: 75
| There is actually a built-in meta tag for html that will make it no-cache...here is the code (this works on all IE versions, and Netscape Navigator:
(In your <head> portion) Code: <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1"> If you don't want that, I believe you can force them to refresh afte a second or so with the following code in the head portion of your page: Code: <meta http-equiv="Refresh" content="1; URL=http://...> However, I don't know if that will do what you want with the caching problems, but it will refresh. And if you put a big enough time on there, it will keep refreshing. However, for a one-time deal, that's not the best solution.
If you really wanted to do javascript, the code is the following (in <script> tags of course  ) Code: function refresh_page() {
window.location = window.location
}
...later in your body tag...
<body onload="setInterval('refresh_page();', 5000)"> Now please beware that the code above will be executed every 5 seconds, as once the page is loaded it will exectue the onload code again. So you might want to do some neat cookie stuff or server-side hidden form variables to make sure that you dont' refresh more than once or so. However, these are the two teqniques that I have come across
Hope this helps,
Ted Morse
__________________ while(1) fork(); |
| |
04-15-2004, 02:22 PM
|
#5 (permalink)
| | Regular Contributor
Join Date: Feb 2003 Location: indisclosed
Posts: 210
| Thanx ender. Going to try out the pragma tags and get this issue out of the way. |
| |
05-13-2004, 06:50 AM
|
#6 (permalink)
| | Registered User
Join Date: May 2004 Location: Heart
Posts: 5
| I'm also having the same problem. and i used the scripts as pasted here. But it did not work for me. the counter on index.html goes on counting everytime I refresh the page. but the content or amendments made did not get refreshed. still showing the old content. Y? |
| |
05-16-2004, 12:32 AM
|
#7 (permalink)
| | Regular Contributor
Join Date: Feb 2003 Location: indisclosed
Posts: 210
| Here's what works for me: Code: <head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
</head> |
| |
05-25-2005, 04:55 AM
|
#8 (permalink)
| | Registered User
Join Date: May 2005
Posts: 9
| Sir,
I'm a beginner in ASP.NET,C#.
I developed a site that displays an image; on every request the image needs to be modified. But in my case, 1st time image is loaded properly but after that the image is not refreshed with the new images; instead the browser displays the image from the cache. I tried the meta tag "Cache-Control", "Pragma",... but still its not working.
This is the code that I had written
+++++++++++
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="My.WebForm1" %>
<%
Response.Buffer = false ;
Response.CacheControl = "No-cache" ;
Response.Expires = -1 ;
Response.AddHeader ("Pragma", "no-cache") ;
%>
<!--Response.CacheControl = "private" ; -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>MyPage</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta http-equiv="imagetoolbar" content="no">
<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body bgColor="#235f91" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Image id="Image1" style="Z-INDEX: 116; LEFT: 323px; POSITION: absolute; TOP: 115px" runat="server"
ImageUrl="file:///E://images/map.gif"></asp:Image></form>
</body>
</HTML>
+++++++++++
Can u pls tell me where I went wrong?
Expecting your reply
Thanks in advance
Cheers
Sujith |
| |
05-25-2005, 06:15 AM
|
#9 (permalink)
| | Newbie
Join Date: Jun 2002 Location: Denmark
Posts: 1,726
| Shouldn't
<META Http-Equiv="Expires" Content="0">
be
<META Http-Equiv="Expires" Content="-1">
Since 0 sets it to infinite.. ie. never expires..
Else I have no clue. |
| |
05-25-2005, 08:12 AM
|
#10 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| on a side note, i am just curious about the word 'sir.' i see it alot so i was just wondering. is that something that is taught to english students? or is it just common to casually address people as sir in other parts of the country.
here in the u.s., it is probably more formal than not, like something you may see in a business letter as opposed to forums or casual conversation. another use may be just sarcasm for fun. this is in no way a flame, just something i think about when i read posts that always start with sir.
__________________ Mike |
| |
05-25-2005, 08:49 AM
|
#11 (permalink)
| | Newbie
Join Date: Jun 2002 Location: Denmark
Posts: 1,726
| hmm.. I've always learned adressing someone with Sir, is apropriate, if you are addressing someone who's been knighted or is of a higher order than you..
My assumption is, that noone attending CodeNewbie has been knighted yet, but you'll never know..
On another side note, I remember having read, the english(uk) 'sir' can be compared to the Germain word Herr, and in germany you address someone Herr, when they are older than you (20 years or more), the word Herr, can be compared with the danish word Hr. which is equivalent to the english(us) Mr. *)
So if we combine all this wordpuzzle, then what we end up with is that the phrase sir can be used, when addressing someone older or of a higher order than you, if we look at this through late night puffs, no pun intended. You could say that the respect shown in addressing the helping staff here with sir is a refference to the knowledge, that the questionere knows the staff members are wiser and on a higher level than their own technical skills.
Or I'm just shooting birds with cannons on this one... *)In this comparison, the reference is to the word Herr and Hr. starting with a capital letter, not the herr/hr, which is used if you only know the last name of a person, as in hr. Rasmussen. I wouldn't know if the word Sir, has a counter part sir like that.. |
| |
05-25-2005, 09:33 AM
|
#12 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| good information there. =) .. I was taking it as the eqivalent to Mr. here. I would use 'Sir' verbally when I used to do tech support and wanted to inturrupt a babbling customer. Quote: |
Sir, Sir, .. Sir please, .. you called me for help right?
|
__________________ Mike |
| |
05-25-2005, 10:20 PM
|
#13 (permalink)
| | Registered User
Join Date: May 2005
Posts: 9
| Sir,
Thanks for the help redhead.But the matter is i tried ,
<META Http-Equiv="Expires" Content="-1">
too,still its not working in the case of images.The image is still being cached.
sde,
I used the word "Sir" to show my respect to the wiser peoples in here.
Cheers,
Sujith
-----------------------------------------------------
"Give respect ,take respect |
| |
05-26-2005, 12:07 AM
|
#14 (permalink)
| | Newbie
Join Date: Jun 2002 Location: Denmark
Posts: 1,726
| Are you sure, it's not the webserver which is caching the images, and not the users browser?
Just a thought, I have no knowledge on how your image is changed, if it's a dynamic generated one from the server, then this shouldn't be the case, but I've seen coincidences where I was out of my head trying to changed and image, and found out it was the webserver caching the old one. |
| |
05-26-2005, 11:48 PM
|
#15 (permalink)
| | Registered User
Join Date: May 2005
Posts: 9
| redhead,
i cross checked the cache of browser ,and i found that the image is being cached at the users browser.Its confirmed since, if i change the setting of the users Browser to get the image on every visit to the page ,then the image is refreshed every time.,but i can't force the customer to do that, thats the reason i really need to know how it can be done using ASP
Cheers,
Sujith
-----------------------------------------------------
"Give respect ,take respect" |
| | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -8. The time now is 01:56 AM. |
Copyright © 2000-2008, Milano Interactive Web Hosting provided by Portal 360 Web Hosting |  | |