How does the Back button in a web browser work?

前端 未结 8 1161
北恋
北恋 2020-11-28 02:57

I searched the Web about this question but I found nothing:

What is the logic of the back button? What is happening when we hit the back button on a Web browser?

8条回答
  •  感情败类
    2020-11-28 03:17

    As a devoloper, you should make sure that your webapp works no matter how the browser handles the Back button :-) Does it resend the request? Is the new request identical to the old one, or does it differ in any way? Will browser ask user to confirm re-POST? What elements of the page will be re-requested and what loaded from cache? Will browser respect my cache-control headers?

    Answers to these question depend on make, version of a browser and user settings. Design you software so that all this doesn’t matter that much.

    Sorry for not very direct answer, but there are some straight answers here already.

提交回复
热议问题