473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax caching on pages...

Mel
I have a page with a <DIVthat gets updated every 10 seconds. The
problem is that unless the browser is configured to get new pages at
all times, it displays the page from cache.

Is there a way to prevent this from happenning ?

Mar 19 '07 #1
12 1388
Mel said the following on 3/19/2007 11:45 AM:
I have a page with a <DIVthat gets updated every 10 seconds. The
problem is that unless the browser is configured to get new pages at
all times, it displays the page from cache.

Is there a way to prevent this from happenning ?
Yes, use a unique URL by adding a timestamp to the URL.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 19 '07 #2
Randy Webb <Hi************ @aol.comwrote in
news:hf******** ************@gi ganews.com:
Mel said the following on 3/19/2007 11:45 AM:
>I have a page with a <DIVthat gets updated every 10 seconds. The
problem is that unless the browser is configured to get new pages at
all times, it displays the page from cache.

Is there a way to prevent this from happenning ?

Yes, use a unique URL by adding a timestamp to the URL.
if you can get to the headers, you can help it too... here is a snippet of
code from my PHP generating pages:

//IE actually caches ajax pages. Just another reason to hate that browser.
header("Expires : Sun, 19 Nov 1978 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache")
Mar 19 '07 #3
Good Man said the following on 3/19/2007 5:03 PM:
Randy Webb <Hi************ @aol.comwrote in
news:hf******** ************@gi ganews.com:
>Mel said the following on 3/19/2007 11:45 AM:
>>I have a page with a <DIVthat gets updated every 10 seconds. The
problem is that unless the browser is configured to get new pages at
all times, it displays the page from cache.

Is there a way to prevent this from happenning ?
Yes, use a unique URL by adding a timestamp to the URL.

if you can get to the headers, you can help it too... here is a snippet of
code from my PHP generating pages:

//IE actually caches ajax pages. Just another reason to hate that browser.
Hate a browser because it doesn't act the way you want it to instead of
learning how to code it. Intuitive.
header("Expires : Sun, 19 Nov 1978 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache")
There is still no guarantee even setting the headers. Adding a timestamp
to the URL is proven to be reliable.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 19 '07 #4
On Mon, 19 Mar 2007 17:54:30 -0400, Randy Webb wrote:
Good Man said the following on 3/19/2007 5:03 PM:
>Randy Webb <Hi************ @aol.comwrote in
news:hf******* *************@g iganews.com:
>>Mel said the following on 3/19/2007 11:45 AM:
I have a page with a <DIVthat gets updated every 10 seconds. The
problem is that unless the browser is configured to get new pages at
all times, it displays the page from cache.

Is there a way to prevent this from happenning ?
Yes, use a unique URL by adding a timestamp to the URL.

if you can get to the headers, you can help it too... here is a snippet
of code from my PHP generating pages:

//IE actually caches ajax pages. Just another reason to hate that
browser.

Hate a browser because it doesn't act the way you want it to instead of
learning how to code it. Intuitive.
It's pretty easy to hate a browser that continually shifts its
"standards" , I've seen many websites that render fine in IE6 that don't
render properly in IE7.

The function of a browser is write once display anywhere... so this is
clearly a failure on MS's part not in the programmers.
Mar 19 '07 #5
Ivan Marsh said the following on 3/19/2007 6:11 PM:
On Mon, 19 Mar 2007 17:54:30 -0400, Randy Webb wrote:
>Good Man said the following on 3/19/2007 5:03 PM:
>>Randy Webb <Hi************ @aol.comwrote in
news:hf****** **************@ giganews.com:

Mel said the following on 3/19/2007 11:45 AM:
I have a page with a <DIVthat gets updated every 10 seconds. The
problem is that unless the browser is configured to get new pages at
all times, it displays the page from cache.
>
Is there a way to prevent this from happenning ?
Yes, use a unique URL by adding a timestamp to the URL.
if you can get to the headers, you can help it too... here is a snippet
of code from my PHP generating pages:

//IE actually caches ajax pages. Just another reason to hate that
browser.
Hate a browser because it doesn't act the way you want it to instead of
learning how to code it. Intuitive.

It's pretty easy to hate a browser that continually shifts its
"standards" , I've seen many websites that render fine in IE6 that don't
render properly in IE7.
I guess you have never tried dynamically creating a table in IE/FF then?
IE gets it right, FF gets it dead wrong. The list is endless both ways.
The function of a browser is write once display anywhere...
No, the function of a browser is to display the resource given to it.
so this is clearly a failure on MS's part not in the programmers.
The same can also be said about FF, Mozilla, Opera, Safari and any other
browser you want to name. Doesn't mean you hate the browser, it means
you learn how to deal with it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 19 '07 #6
On Mon, 19 Mar 2007 18:24:17 -0400, Randy Webb wrote:
Ivan Marsh said the following on 3/19/2007 6:11 PM:
>On Mon, 19 Mar 2007 17:54:30 -0400, Randy Webb wrote:
>>Good Man said the following on 3/19/2007 5:03 PM:
Randy Webb <Hi************ @aol.comwrote in
news:hf***** *************** @giganews.com:

Mel said the following on 3/19/2007 11:45 AM:
>I have a page with a <DIVthat gets updated every 10 seconds. The
>problem is that unless the browser is configured to get new pages at
>all times, it displays the page from cache.
>>
>Is there a way to prevent this from happenning ?
Yes, use a unique URL by adding a timestamp to the URL.
if you can get to the headers, you can help it too... here is a snippet
of code from my PHP generating pages:

//IE actually caches ajax pages. Just another reason to hate that
browser.
Hate a browser because it doesn't act the way you want it to instead of
learning how to code it. Intuitive.

It's pretty easy to hate a browser that continually shifts its
"standards" , I've seen many websites that render fine in IE6 that don't
render properly in IE7.

I guess you have never tried dynamically creating a table in IE/FF then?
IE gets it right, FF gets it dead wrong. The list is endless both ways.
>The function of a browser is write once display anywhere...

No, the function of a browser is to display the resource given to it.
>so this is clearly a failure on MS's part not in the programmers.

The same can also be said about FF, Mozilla, Opera, Safari and any other
browser you want to name. Doesn't mean you hate the browser, it means
you learn how to deal with it.
So you think it's perfectly okay for three versions of the same browser
from the same company to display the same information three different ways?

You're very forgiving.
Mar 19 '07 #7
Ivan Marsh said the following on 3/19/2007 6:26 PM:
On Mon, 19 Mar 2007 18:24:17 -0400, Randy Webb wrote:
>Ivan Marsh said the following on 3/19/2007 6:11 PM:
>>On Mon, 19 Mar 2007 17:54:30 -0400, Randy Webb wrote:

Good Man said the following on 3/19/2007 5:03 PM:
Randy Webb <Hi************ @aol.comwrote in
news:hf**** *************** *@giganews.com:
>
>Mel said the following on 3/19/2007 11:45 AM:
>>I have a page with a <DIVthat gets updated every 10 seconds. The
>>problem is that unless the browser is configured to get new pages at
>>all times, it displays the page from cache.
>>>
>>Is there a way to prevent this from happenning ?
>Yes, use a unique URL by adding a timestamp to the URL.
if you can get to the headers, you can help it too... here is a snippet
of code from my PHP generating pages:
>
//IE actually caches ajax pages. Just another reason to hate that
browser.
Hate a browser because it doesn't act the way you want it to instead of
learning how to code it. Intuitive.
It's pretty easy to hate a browser that continually shifts its
"standards" , I've seen many websites that render fine in IE6 that don't
render properly in IE7.
I guess you have never tried dynamically creating a table in IE/FF then?
IE gets it right, FF gets it dead wrong. The list is endless both ways.
>>The function of a browser is write once display anywhere...
No, the function of a browser is to display the resource given to it.
>>so this is clearly a failure on MS's part not in the programmers.
The same can also be said about FF, Mozilla, Opera, Safari and any other
browser you want to name. Doesn't mean you hate the browser, it means
you learn how to deal with it.

So you think it's perfectly okay for three versions of the same browser
from the same company to display the same information three different ways?
Just curious, but did you ask the same thing when NS7 came out with
regards to three different versions displaying the same information
three different ways? Or, is it just MS that makes it "different" ?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 19 '07 #8
On Mon, 19 Mar 2007 19:05:22 -0400, Randy Webb wrote:
Ivan Marsh said the following on 3/19/2007 6:26 PM:
>On Mon, 19 Mar 2007 18:24:17 -0400, Randy Webb wrote:
>>Ivan Marsh said the following on 3/19/2007 6:11 PM:
On Mon, 19 Mar 2007 17:54:30 -0400, Randy Webb wrote:

Good Man said the following on 3/19/2007 5:03 PM:
>Randy Webb <Hi************ @aol.comwrote in
>news:hf*** *************** **@giganews.com :
>>
>>Mel said the following on 3/19/2007 11:45 AM:
>>>I have a page with a <DIVthat gets updated every 10 seconds.
>>>The problem is that unless the browser is configured to get new
>>>pages at all times, it displays the page from cache.
>>>>
>>>Is there a way to prevent this from happenning ?
>>Yes, use a unique URL by adding a timestamp to the URL.
>if you can get to the headers, you can help it too... here is a
>snippet of code from my PHP generating pages:
>>
>//IE actually caches ajax pages. Just another reason to hate that
>browser.
Hate a browser because it doesn't act the way you want it to instead
of learning how to code it. Intuitive.
It's pretty easy to hate a browser that continually shifts its
"standards ", I've seen many websites that render fine in IE6 that
don't render properly in IE7.
I guess you have never tried dynamically creating a table in IE/FF
then? IE gets it right, FF gets it dead wrong. The list is endless
both ways.

The function of a browser is write once display anywhere...
No, the function of a browser is to display the resource given to it.

so this is clearly a failure on MS's part not in the programmers.
The same can also be said about FF, Mozilla, Opera, Safari and any
other browser you want to name. Doesn't mean you hate the browser, it
means you learn how to deal with it.

So you think it's perfectly okay for three versions of the same browser
from the same company to display the same information three different
ways?

Just curious, but did you ask the same thing when NS7 came out with
regards to three different versions displaying the same information
three different ways? Or, is it just MS that makes it "different" ?
I do remember one occasion where minor changes in the way Netscape
rendered caused issue with some web sites... in Netscape 6.0
Mar 20 '07 #9
Ivan Marsh said the following on 3/20/2007 10:45 AM:
On Mon, 19 Mar 2007 19:05:22 -0400, Randy Webb wrote:
>Ivan Marsh said the following on 3/19/2007 6:26 PM:
>>On Mon, 19 Mar 2007 18:24:17 -0400, Randy Webb wrote:

Ivan Marsh said the following on 3/19/2007 6:11 PM:
On Mon, 19 Mar 2007 17:54:30 -0400, Randy Webb wrote:
>
<snip>
>>>>so this is clearly a failure on MS's part not in the programmers.
The same can also be said about FF, Mozilla, Opera, Safari and any
other browser you want to name. Doesn't mean you hate the browser, it
means you learn how to deal with it.
So you think it's perfectly okay for three versions of the same browser
from the same company to display the same information three different
ways?
Just curious, but did you ask the same thing when NS7 came out with
regards to three different versions displaying the same information
three different ways? Or, is it just MS that makes it "different" ?

I do remember one occasion where minor changes in the way Netscape
rendered caused issue with some web sites... in Netscape 6.0
Did you "Hate Netscape" or write it off as a cost of progress?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 20 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
1619
by: Bugsy | last post by:
hi fellows pro,,,,, i want some details regarding AJAX. can anyone help me in that .... reply me with some good articles as well as tutorials in (.net)
1
1495
by: one | last post by:
Hi, I just went into a debate with my colleague regarding these technologies. I think they are not the same: At a high-level... Client-side caching is to do with temporary internet file and the 'check for newer verions of stored pages' setting in Internet Explorer Server-side caching is to do with asp.net and IIS. It instructs how IIS...
5
7838
by: Raj | last post by:
What is the purpose of file system caching while creating a tablespace? Memory on the test server gets used up pretty quickly after a user executes a complex query(database is already activated), after some investgation i found out that most of it being consumed by filesystem caching... thanks to Liam and Phil Sherman for their valuable...
3
2935
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains say “www.Test1.com” and “www.Test2.com” pointing to a single website. Website content is located onto UNCPath i.e. remote location. Domain...
1
1763
by: JohnnieTech | last post by:
I am using some javascript/ajax to load content into a main div. The problem I am running into is that it will work in IE but not in FF. In FF I don't get any sort of load at all. I have a 1 column 2 row setup in css. The links are in the top div and the content loads in the main div. The only problem I thought may have been causing it was...
1
2514
by: Yan | last post by:
Hi, I'm apparently far from being the 1st one to meet this error... My asp.net ajax page requires ScriptManager.axd but gets a 404. following a lot of "This is how I solved it" posts, I : - checked my web.config (copied below) - re-installed the ajax.net extensions - ran aspnet_regiis my application
8
2719
by: Tomasz J | last post by:
Hello developers, After migrating my web project application (using the old model) to .Net Framework 3.5 and Ajax Control Toolkit release 20820 the Accordion control no longer works correctly. In certain cases (only) it renders but is dead - does not initialize. Before the migration it worked, no changes have been made. Here is the...
19
1422
by: Conrad Lender | last post by:
| 5.40 Why is my Ajax page not updated properly when using an HTTP GET | request in Internet Explorer? | | Microsoft Internet Explorer caches the results of HTTP GET requests. | To ensure that the document is retrieved from the server, you will | need to use the POST Method. | | * http://msdn2.microsoft.com/en-us/library/ms536648.aspx ...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.