reload php page on browser back button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • 4psite

    #1

    reload php page on browser back button

    I am creating (using php) an html page with many links.
    Clicking on a link open the link as _self.
    Clicking on the browser back button brings the prv html page (with the
    links,) but instead of getting it from the cache it will recreate it.
    My questiosn, how to avoid the re-creation of the php/html page and
    just to reload it from the cache.

    Coby

  • NC

    #2
    Re: reload php page on browser back button

    4psite wrote:[color=blue]
    >
    > I am creating (using php) an html page with many links.
    > Clicking on a link open the link as _self.
    > Clicking on the browser back button brings the prv html page (with the
    > links,) but instead of getting it from the cache it will recreate it.
    > My questiosn, how to avoid the re-creation of the php/html page and
    > just to reload it from the cache.[/color]

    Send an "Expires:" header, perhaps? Something like this:

    header('Expires : ' . date('r', time() + 3600));

    This will tell the browser that the content it just received is going
    to be valid for another hour (3,600 seconds), so it shouldn't bother
    getting an updated version from the server. If you want a longer
    period, just increase the number...

    This said, note that almost any HTTP header is a suggestion, not an
    order. There is nothing you can do to force a client to obey the
    header, if it chooses not to...

    Cheers,
    NC

    Comment

    • 4psite

      #3
      Re: reload php page on browser back button

      Thank you NC.
      The header thing didn't work. Any other creative idea?
      Are u aware of any PHP command that will instruct the browser to reload
      it?
      I am wondring if start_session or similar commands are causing the
      browser to reload it
      Coby

      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: reload php page on browser back button

        4psite wrote:[color=blue]
        > Thank you NC.
        > The header thing didn't work. Any other creative idea?
        > Are u aware of any PHP command that will instruct the browser to reload
        > it?
        > I am wondring if start_session or similar commands are causing the
        > browser to reload it[/color]

        You're right, session will force not to use cache.
        <news:111247188 9.810924.221330 @z14g2000cwz.go oglegroups.com> (
        http://groups.google.com/group/comp....9f341b6ab55630 )

        --
        <?php echo 'Just another PHP saint'; ?>
        Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

        Comment

        Working...