X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

What can cause an XMLHttpRequest refresh?

Posted

I am developing a JavaScript program that uses XMLHttpRequest to fetch an XML file from my Apache server. It all works splendidly, but changes to my XML file that I make externally are not reflected in my test page until I Quit and ReLaunch Firefox. Is there another way to get an XMLHttpRequest to re-read the file off the server?

Changes to my javaScript program, or the HTML that carries it, are reflected quickly when I simply click on the Refresh icon at the right end of the URL bar. (I think I may have set something in Preferences to get this effect.) However, any changes I make with a text editor to the XML file on the server that the program is fetching don't show up right away. I have to Quit and ReLaunch Firefox to get those changes to show up.

Evidently, the XMLHttpRequest mechanism must be caching the file somewhere. This isn't a terrible idea, as the file is rather large, but it is annoying whilst developing. Is there a way to mitigate this caching?

--Gil

Modified by GilDawson

Chosen solution

Try to reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.

  • Press and hold Shift and left-click the Reload button.
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Command + Shift + R" (MAC)

You can also try to disable the HTTP cache while testing by setting the Boolean pref network.http.use-cache to false on the about:config page.


A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.

Read this answer in context 1

Additional System Details

Installed Plug-ins

  • Shockwave Flash 11.5 r502
  • Displays Java applet content, or a placeholder if Java is not installed.
  • The QuickTime Plugin allows you to view a wide variety of multimedia content in web pages. For more information, visit the QuickTime Web site.
  • Office Live Update v1.0
  • The Google Earth Plugin allows you to view 3D imagery and terrain in your web browser.
  • DivX Web Player version 2.0.2.39
  • The Flip4Mac WMV Plugin allows you to view Windows Media content using QuickTime.
  • RealPlayer Plugin
  • Plugin for viewing Sibelius(tm) music scores http://www.sibelius.com
  • iPhoto6
  • Musicnotes Viewer plugin 1.17.2 http://www.musicnotes.com

Application

  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20100101 Firefox/17.0

More Information

I'm using Apache for a server. I'm not sure how to tell which version, but it's whatever comes with MacOS 10.6.8. View the program at http://deccles.com/CACont/.

cor-el
  • Top 10 Contributor
  • Moderator
10740 solutions 96657 answers

Chosen Solution

Try to reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.

  • Press and hold Shift and left-click the Reload button.
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Command + Shift + R" (MAC)

You can also try to disable the HTTP cache while testing by setting the Boolean pref network.http.use-cache to false on the about:config page.


A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.

Question owner

Thanks, cor-el. Command-Shift-R seems to do the trick!

Thanks also for introducing me to the Evangelism forum and the about:config page. Seems I have new worlds to explore!

Thanks for your help.

--Gil

cor-el
  • Top 10 Contributor
  • Moderator
10740 solutions 96657 answers

You're welcome