CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    4

    xmlhttprequest and the cache

    Hello guys, I am writing a program using ajax (obviously). The javascript calls a php script which writes an xml file that the javascript then uses to generate stuff.

    The problem comes from the fact that the xml file that I receive is out of date and in fact does not update unless I physically access the xml file and refresh the page. This leads me to believe that the old page is getting cached so the new file is not getting looked at.

    So far I have tried
    obj.setRequestHeader("Expires", "0");
    obj.setRequestHeader("Cache-Control", "no-store");
    obj.setRequestHeader("Cache-Control", "no-cache");
    but to no effect. Any help would be appreciated.

  2. #2
    Join Date
    Mar 2010
    Posts
    4

    Re: xmlhttprequest and the cache

    SOLVED: setRequestHeader only works with POST not GET

  3. #3
    Join Date
    Mar 2010
    Posts
    4

    Re: xmlhttprequest and the cache

    update: setRequestHeader was not needed when using POST either

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured