473,698 Members | 2,666 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 1290


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
7843
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
3897
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
1868
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
1410
by: ALPO | last post by:
ANy good examples of paging against a cached dataset. Our datasets will be cached in viewstate.
2
2315
by: Thomas | last post by:
Hi, Is AppSettings cached? And is the cache updated when web.config changes? - Thomas
2
1455
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
4295
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
2985
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
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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
9023
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7721
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
6518
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
4366
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...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.