Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#250410 - 24/02/2005 22:00 I.E. cacheing hell
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
I'm hoping someone here knows the magic incantation of server side cacheing parameters to make I.E. behave like every other web browser. Here is the scenario, I have three web pages that flow like so...

(Page 1) -- post --> (Page 2) -- post --> (Page 3)

Page 1 is a registration form, page 2 is a survey form and page 3 is an error page. In this user flow the error page is shown because the user did not properly fill out the survey (page 2).

For this website we are dealing with somewhat sensitive personal information and the pages are all dynamic and provide different content at different points during the user's session. Therefor it is important that pages are not cached. I already have the collection of magical headers setup to keep anything from being cached in all modern browsers.

Now, here is the problem. When the user hits page 3 above they see an error prompting them to go back and fix their mistakes. In every browser except IE the user can use their browser's back button or a javascript control to go back a page. When they do this the page is pulled from cache and they can fix their mistake and resubmit. The page can be pulled from cache because they used their back button to generate a history request which is treated differently than a normal web request. This is how things are supposed to work AFAIK.

Unfortunately I.E. doesn't work this way. It throws up an error message asking if it is OK to resubmit the form. If they say yes then it tries to resubmit the account create (page 1) which is bad, if they say no then they get a different IE error page telling them the page can not be displayed.

So the question is how to allow IE to cache pages only for the purpose of its history (the forward/backward buttons) and not for normal GET/POST requests. Help?

The cacheing headers that are currently being set are...

Code:
// Set to expire far in the past.
Expires: Sun, 7 May 1995 12:00:00 GMT

// Set standard HTTP/1.1 no-cache headers.
Cache-Control: no-store, no-cache, must-revalidate

// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
Cache-Control: post-check=0, pre-check=0

// Set standard HTTP/1.0 no-cache header.
Pragma: no-cache



Thanks,
-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#250411 - 24/02/2005 22:21 Re: I.E. cacheing hell [Re: mcomb]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I'm just taking a guess, but you've got two separate Cache-Control headers. Maybe they should be combined into a single one?
_________________________
Bitt Faulk

Top
#250412 - 24/02/2005 22:32 Re: I.E. cacheing hell [Re: wfaulk]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
Good guess, but the first one is a standard header and the second is I.E. specific. If you combine them then Netscape based browsers ignore the combined header. With them separate Netscape drops the I.E. specific header, but still honors the standard one.

The more I think about this I'm almost positive there isn't a workable solution as even if I can get IE to pull the page from it's history I'm just going to hit another IE specific bug (some versions of IE will randomly clear all form fields when you use the back button to revisit a form). Hmmm...

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#250413 - 24/02/2005 22:40 Re: I.E. cacheing hell [Re: mcomb]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
Maybe do some checking of the info in the form before submitting? and just error when they click the submit telling them whats wrong and to correct it?
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#250414 - 24/02/2005 22:42 Re: I.E. cacheing hell [Re: mcomb]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
Isn't the usual method of doing this just to spit the form out again with their incomplete input filled in and the offending section highlited?

Matthew

Top
#250415 - 24/02/2005 22:45 Re: I.E. cacheing hell [Re: matthew_k]
JBjorgen
carpal tunnel

Registered: 19/01/2002
Posts: 3582
Loc: Columbus, OH
Yeah...what Matthew said...much more elegant solution.
_________________________
~ John

Top
#250416 - 24/02/2005 22:49 Re: I.E. cacheing hell [Re: SonicSnoop]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
Quote:
Maybe do some checking of the info in the form before submitting? and just error when they click the submit telling them whats wrong and to correct it?


I'd love to, but for historical reasons I can't. I've got several sites running on the same backend and the javascript code required to do that form validation on this specific page isn't possible without changing the layout and names of the form fields on the page. If I do that then I break all the other sites and I don't have the time/staff to update and retest the other sites.

I think the right answer is after processing the data from the form on page 1 to redirect to page 2. That way I.E. shouldn't prompt to repost the form data and even if it does prompt to refetch page 2 it won't cause a problem. I've still got to figure out what else that might break though

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#250417 - 24/02/2005 22:55 Re: I.E. cacheing hell [Re: matthew_k]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
Quote:
Isn't the usual method of doing this just to spit the form out again with their incomplete input filled in and the offending section highlited?


Yeah, that would be ideal, but it isn't a change I can make quickly. Like I said in that last post I've got a bunch of sites running on a shared code base and I can't easily rebuild them all to work that way at this point.

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#250418 - 25/02/2005 00:45 Re: I.E. cacheing hell [Re: mcomb]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
Quote:
Quote:
Maybe do some checking of the info in the form before submitting? and just error when they click the submit telling them whats wrong and to correct it?


I'd love to, but for historical reasons I can't. I've got several sites running on the same backend and the javascript code required to do that form validation on this specific page isn't possible without changing the layout and names of the form fields on the page.


I starred at this until my eyeballs began to bleed and figured out the required javascript code to do the validation client side without affecting the other sites. That will take care of 99% of people which is good enough for this site. Thanks for making me rethink that approach.

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#250419 - 25/02/2005 03:21 Re: I.E. cacheing hell [Re: mcomb]
oliver
addict

Registered: 02/04/2002
Posts: 691
I ran into the same problem. I found with an .asp page I could add the following to disable caching on my login form. I think the header you're missing is "Pragma" = "no-cache"

Edit: You actually have the pragma setting, I should have read through the whole post first.

Code:
<% Response.CacheControl = "no-cache" %>

<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>



Edited by oliver (25/02/2005 03:23)
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top