Refreshing principles of browsers

Source: Internet
Author: User

We are doing a product filtering function tonight, filtering the product list through dozens of product parameters, because there are too many parameters, and considering the SEO part, so I don't want to expose the part of the parameter passed in the address bar, so I use POST to pass the value, however, when users refresh the page, the POST value is always prompted whether to re-POST the dialog box. I searched it using the search engine. Currently, the most common solutions on the market have been tested, but none of them are suitable for me. finally, I tried to use js to assign a random number to the action at the client latency. I even tested the method of dynamically creating form forms with js latency, but the problem still could not be solved, I can see an article occasionally to understand the cause. I am afraid to share it with you privately.

As we all know, the browser uses Last-Modified and Expires to process the cache. The specific mechanism is not explained, but the specific debugging does not follow our imagination, the reason is probably because the browser is refreshed incorrectly. For most browsers, there are three refresh methods. The following uses ie as an example:

F5 refresh

Ctrl + F5 refresh

"Go" or press enter in the address bar to refresh

The functions of these shortcut keys are the same in mainstream browsers.

These three refresh methods will lead to different cache mechanisms adopted by the browser:

F5: the browser is not allowed to directly use the local cache, so Last-Modified can work, but Expires is invalid.

Ctrl + F5: the cache mechanism is invalid because it is forced to refresh.

"Go" or press enter in the address bar: normal access. Both Last-Modified and Expires are valid.

After you know that refresh the browser is still the case, you will not be confused in the project debugging process in the future.

To sum up, we can think that when the browser refreshesLast post ParameterI handed it back to the server again, and no matter whether you make any changes in the process, he will ignore it, instead, it faithfully resends all the parameters of the last POST to the server. therefore, the final conclusion of my problem is unsolved !!! Sorrow ~~~

I just looked at the blog Park's homepage page flip seems similar, but worse, in non-first page refresh page directly ran back to the first page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.