473,715 Members | 6,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Are XmlHttpRequests being cached?

I have a situation where I'm using XmlHttpRequests to update some data
in a table every few seconds. The script that executes when the data
comes into the browser checks to see if the data has changed compared
to that currently displayed - if it hasn't changed, it does not update
anything.

I'm having a problem on ONE single computer in that changed data is
being sent but the script doesn't see it. I found that if I cleared
the browser cache, then it worked as expected - once - then it fails
again.

This HttpRequest contains only a small data string - it's not an
entire page. Is there a way to get the browser to use the lastest data
and not the cached data?
Jul 23 '05 #1
1 1292


Martin wrote:

This HttpRequest contains only a small data string - it's not an
entire page. Is there a way to get the browser to use the lastest data
and not the cached data?


It is call XMLHttpRequest as it uses HTTP so you can use all the tools
(e.g. HTTP headers) HTTP provides to suggest whether/how a resource is
cached or not:
<http://www.mnot.net/cache_docs/>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

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

Similar topics

6
7844
by: Robert Scheer | last post by:
Hi. I have two .js files that are used on several of my pages. I made some changes in one of the files. When I call the pages, the old functions are called because of the browser's cache. What is the best way to update the browser's cache with the newer version of my .js file? Thanks, Robert Scheer
1
1918
by: Harod Ruthgar | last post by:
var image = new Image(); image.src="pathToTheFile"; The above code is called 25 times (with different pathToTheFile) within a loop. I manually checked the cache directory and not all images are cached, sometimes it's only 3, sometimes 4, etc, and mostly only the last few images within the loop.
21
3902
by: Jay Levitt | last post by:
I'm just starting to play around with CSS and MovableType. My home page (http://www.jay.fm) now validates on both the CSS and the XHTML. However, the Google cached version shows the wrong font in IE6. This seems to be because of the "header" they place before the <head> block; if I save the cached copy to disk and edit that out, it displays fine. It's not a big deal, but I don't notice this problem on other pages, so I wondered if...
10
1870
by: cosmic foo | last post by:
I have a page with about 100 images of about 10k each. where a typical img tag looks like this, <img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)" border="0"> Not all the images need to be viewed at once, depending on what category is selected, only about 10 images are seen at any one time. I hide and show categories of images by setting a div container display:none/block or visibility:hidden/visible. Even though the...
2
1412
by: ALPO | last post by:
ANy good examples of paging against a cached dataset. Our datasets will be cached in viewstate.
2
2316
by: Thomas | last post by:
Hi, Is AppSettings cached? And is the cache updated when web.config changes? - Thomas
2
1459
by: JTS | last post by:
How can I view all pages, user controls, etc that are currently cached? I simply want to know which pages have been cached, and which versions of the pages are currently cached. Is this possible?
17
4296
by: Assaf Lavie | last post by:
I'm trying to run multiple xmlhttprequests in parallel in response to a button click. I want to launch N asynchronous requests and handle the responses as they come. The problem is that no request is actually transmitted until the previous one finishes, as though the browser limits the number of actual connections to 1 and puts my requests in a queue. I tried this on FF and IE. Here's the code: function newReq() {
4
2987
by: jeff.maildump | last post by:
Hi, I've got multiple xmlhttprequests which are in a loop. So this is the loop I have so far, with the closure given to me in a previous post: //------------------------------------------------------------------------------------- for (i=0; i<data.length; i++) { httpRequest = false; httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function(index) {
0
8823
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9343
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9047
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7973
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6646
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4477
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2119
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.