SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)

    Redirects... which one is most appropriate here?

    O bhikkhus,

    My colleague has introduced something new to our forms, and is currently relying on a meta refresh
    Code:
    <meta http-equiv="Refresh" content="0; URL=resultspageurl" />
    to make it work. We want this to actually work with all (most) user agents, don't care about search engines (this is humans-only territory) and want the back button to work properly. I could get search results here if I kept the number of search words to one: redirect, which helped me look in the area of redirect server codes... still need some advice.

    As I'm a front-ender not a back-ender I'm only vaguely familiar with redirect codes and reading about them, I still can't tell which one, if any, is appropriate and will even work in IE.

    What we have is a long form. The user fills it in. They hit submit. This form, unlike our previous forms, has enough information that it can take several seconds (possibly up to half a minute, an age in Internet time) before the results can be displayed. It uses POST of course.

    So first we thought of having a "Busy with calculating, this can take a while..." page, with even a little animated gif, and when the results are finished the user is redirected (is this what we really want?) to the results page.

    Hitting Back should take them back to the form page, not the "busy..." page. We're using sessions id's to keep that form filled in while the user goes from page to page and hits BACK. The true URL to be served, eventually, from the SUBMIT is the results page.

    So I'm looking at
    302 (temporarily moved-- doesn't look like the one I want)
    303 (see other... not sure I understood the description here, the goal is not the temporary page but the results page)
    and
    307 (temporary redirect)
    the sources I find explaining this one spend so much time on SEO which I can completely ignore here (googlebots had better not be trying to get insurance quotes!).

    It looks like I think we want either a 303 or a 307. Not sure what to do about any possible old user agent who doesn't do HTTP1.1 but I'm thinking we'll never see them... so far I've only seen the Yahoo Slurp on some other pages and apparently it's faking the HTTP1.0 thing anyway (plus, we don't care about it).

    Am I heading in the right direction (a header redirect) or should I be looking at something else completely? I'm trying to think, the server would have to know when the calculations are done (which could be under a second, or 30 seconds, or possibly longer) before redirecting the user, so am I going the wrong way?

    All these are within the same domain, I don't want to have the UA have to do any DNS checking or anything weird if we can help it. No external domains, which I also saw mentioned a lot on these redirect sites.

    Thx in advance
    -poes

  2. #2
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Update, it's looking like since we should be using a 303 for POST-Redirect-GET anyway (for our POST forms so the back button works) we're working with trying a 303 redirect, and maybe two of them if we want a temp page, then a new redirect. Everyone built in this century should correctly understand 303.

    Not sure if it's really a good idea to load a new temp page stating "processing..." in the first place, so if this doesn't work we'll try something else to reassure people that nothing's broken if they're waiting a while.

    I had run across this like a few months ago but didn't think of it right away:http://www.theserverside.com/pattern...hread_id=20936
    Not sure if it's too old but it's pretty informative.


Bookmarks

Posting Permissions

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