Resolve browser cache

I have always been accustomed to adding a timestamp to the end of the URL address jump. I have not thought about the reason. In order to solve the doubts of the back-end partners, I checked it and realized that this is the way to solve the browser cache.

Function: The time is appended to the end of the URL. This ensures that the request will not be cached after it is sent for the first time, but will be re-created and re-sent every time this method is called; the URL will be slightly different due to the time stamp. This technique is often used to ensure that each POST to the script will actually generate a new request and the web server will not try to cache the response from the server. —-Explanation from Lu Caifang’s column
https://blog.csdn.net/tolcf/article/details/40339899

The jump implementation method of my project

window.location.href = "handle.html?time=" + new Date().getTime();

Guess you like

Origin blog.csdn.net/zn740395858/article/details/80314194