473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP Headers not refreshing AJAX in Firefox

21
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:

Expand|Select|Wrap|Line Numbers
  1.     Response.AddHeader "Expires", "Mon, 08 May 1983 05:00:00 GMT"
  2.  
  3.     Response.AddHeader "Last-Modified", Now & " GMT"
  4.  
  5.     Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
  6.  
  7.     Response.AddHeader "Pragma", "no-cache"
  8.  
  9.     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.
Jan 17 '07 #1
3 5752
gyung
21
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 :)



Expand|Select|Wrap|Line Numbers
  1.     Response.Expires = -1
  2.     Response.AddHeader "Cache-Control", "no-cache"
  3.     Response.AddHeader "Cache-Control", "private"
  4.     Response.AddHeader "Cache-Control", "no-store"
  5.     Response.AddHeader "Cache-Control", "must-revalidate"
  6.     Response.AddHeader "Cache-Control", "max-stale=0"
  7.     Response.AddHeader "Cache-Control", "post-check=0"
  8.     Response.AddHeader "Cache-Control", "pre-check=0"
  9.     Response.AddHeader "Pragma", "no-cache"
  10.     Response.AddHeader "Keep-Alive", "timeout=3, max=993"
  11.     Response.AddHeader "Expires", "Sun, 08 May 1983 05:00:00 GMT"
Jan 17 '07 #2
iam_clint
1,208 Expert 1GB
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 :)
Jan 18 '07 #3
Atli
5,058 Expert 4TB
I'm betting its the

Response.AddHeader "Cache-Control", "no-cache"

that did the trick.

It worked for me in a simular situation a while ago.
Jan 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
1
by: evanpmeth | last post by:
I am currently working a program that was intended to be purely JS and AJAX. Due to the cross domain access problems i have defaulted to a language I enjoy more, Python. My project consists of a...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
3
by: user | last post by:
Hi, let's say a page loads on a browser. Without refreshing the page, multiple textboxes within the page gets real time data @ a few seconds interval. what is the logic behind to achieve...
4
by: ext237 | last post by:
Simple ajax call seems to have some issues in Firefox. The "onComplete:" is called BEFORE the response is returned by the call. Is there a coding issue or a work around? var ajax = new...
7
by: adrive | last post by:
hi guys, I'm new to ajax and i'm just following the examples from tizag and w3schools. Apparently, an application i'm trying to build is showing very peculiar behaviour. I have a <span>...
7
by: raknin | last post by:
I'm using AJAX on my website, but internet explorer does not seem to actually be refreshing the data I retrieve via AJAX when I refresh the page. For example, I have a button that when pressed uses...
29
by: zalek | last post by:
I am writing application with Ajax in sync mode - xmlHttp.open("GET", url, false). I noticed that in FireFox handler doesn't starts. It starts when I use xmlHttp.open("GET", url,true). I need to...
8
by: Harvey Schmidlapp | last post by:
I have a fairly complex form (generated by means of an ASP 3 page). The form is used to define a query against a database. After running a query, the user hits their browser's back button and goes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...

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.