ASP Headers not refreshing AJAX in Firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gyung
    New Member
    • Dec 2006
    • 21

    ASP Headers not refreshing AJAX in Firefox

    Originally I had a problem with IE because I forgot to set the no-cache in the ASP pages that AJAX calls. Now that I added the headers, it works fine in IE, but still doesn't refresh properly in FF. I maintain the correct last browsed position using sessions, and works flawlessly in IE (so far), but FF, when the BACK button is used, it doesn't update.

    I'm assuming is a cache problem, because as soon as I refresh the page manually (F5), it works fine (I programmed it that way).

    I'm using:

    Code:
    	Response.AddHeader "Expires", "Mon, 08 May 1983 05:00:00 GMT"
    
    	Response.AddHeader "Last-Modified", Now & " GMT"
    
    	Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
    
    	Response.AddHeader "Pragma", "no-cache"
    
    	Response.Expires = -1
    I'm not sure if I'm not in the right section to ask, but hopefully there's another way to refresh using ASP... JSP didn't work for me either.
  • gyung
    New Member
    • Dec 2006
    • 21

    #2
    After lots and lots of searching, I found a script that is working.
    I guess one of these things properly tell FF not to cache. Hope this will help someone with a similar problem :)



    Code:
    	Response.Expires = -1
    	Response.AddHeader "Cache-Control", "no-cache"
    	Response.AddHeader "Cache-Control", "private"
    	Response.AddHeader "Cache-Control", "no-store"
    	Response.AddHeader "Cache-Control", "must-revalidate"
    	Response.AddHeader "Cache-Control", "max-stale=0"
    	Response.AddHeader "Cache-Control", "post-check=0"
    	Response.AddHeader "Cache-Control", "pre-check=0"
    	Response.AddHeader "Pragma", "no-cache"
    	Response.AddHeader "Keep-Alive", "timeout=3, max=993"
    	Response.AddHeader "Expires", "Sun, 08 May 1983 05:00:00 GMT"

    Comment

    • iam_clint
      Recognized Expert Top Contributor
      • Jul 2006
      • 1207

      #3
      thanks for posting your fix it really helps for those unanswered questions, because someone out there will have a similiar problem and end up at this thread and see the fix :)

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        I'm betting its the

        Response.AddHea der "Cache-Control", "no-cache"

        that did the trick.

        It worked for me in a simular situation a while ago.

        Comment

        Working...