MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Using the browser back button and updating an item-list




Miles,

  This is a constant problem with all reasonably complex
CGI applications.  I have a few ideas for workarounds
though.

  The best answer I have found is just not to worry
about it.  There's really nothing you can do, since
browsers are free to handle caching any way they
like.  The problem is worse with Internet Explorer,
which sometimes ignores expiration directives altogether.

  If you look around at big e-commerce sites, you'll
notice two things:

  1) Nobody handles the back button correctly (by 
     refreshing).

  2) Most don't try to force a reload when the back button
     is pressed.  

  I *never* expire pages immediately;  I think it's 
better to present old information then to get the 
user hopelessly lost in a sea of error messages.  A 
small bit of consolation is that novices who are 
most likely to get confused usually don't make much 
use of the back button.
 
  A scratch variable won't help you, as all variable 
interpolation happens on the server side, nothing happens
unless the page is reloaded.

  One solution:  Put a back button on the page, and
have it re-send the same form variables to the 'referer'
page.
 
  Since form values are local to the session, and persistent
across pages, you should be able to access the search
parameters using [value] even if they haven't been 
explicitly submitted.  I use this technique myself, but
I've never tried it with the search feature. 

  Your mini-basket idea is really cool.  Maybe you could
structure you're pages so that the mini-basket is in
a frame at the bottom or side.  That way, you expire just 
the frame, and the browser won't complain about expired
POST data.  Of course, if IE ignores the "don't cache"
order, the frame still won't get updated.

  Hope this helps,

   Lee Nelson

Miles Eddins wrote:
> 
> ******    message to minivend-users from "Miles Eddins" <miles_eddins@hotmail.com>     ******
> 
> Hi Folks,
> 
> I have gone round and round and round with this, trying to think of all the
> possible ways to accomplish this task. No luck yet. I have a persistent
> "mini basket" on all pages that just uses:
> 
> [if items]
>    [then]
>    [item-list]
>       [item-quantity]
>       [item-field title]
>    [/item-list]
>    [/then]
>    [else]Your shopping cart is empty.
>    [/else]
> [/if]
> 
> to list whatever a person has in their basket. Actually, I put this code in
> its own file and use [include ..] to pull it in, so it will work on
> flypage.html and browse1.html. Anyway, the problem is when I add an item to
> the basket (which takes me to basket.html) and then use the browser's back
> button to return to the page, the mini basket doesn't update itself (since
> the page is cached). Now if I put <META HTTP-EQUIV="expires" CONTENT="0"> on
> the page, that works out fine, and the mini basket updates itself to reflect
> the added items when I return to that page. However, when the page in
> question is the search results page, this is a problem because you get a
> "Data Expired" page telling you that this page resulted from a POST
> operation etc. etc. when you return to it.
> 
> I have zero programming background, so this may be a dumb question, but is
> this something a scratch variable could take care of? By being passed when
> the user clicks on "Add Item" and then re-read when the browser's back
> button is pressed? Is there a "Scratch Variables for Beginners" somewhere?!
> Thanks,
> 
> Miles
> 
> _______________________________________________________________
> Get Free Email and Do More On The Web. Visit http://www.msn.com
> -
> To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: