Window.open JavaScript function inherently opens the cached version of the page requested. For the first time the web page will be brought from the server, but for subsequent requests it will display the cached version of the page that was bought first. How to avoid this..?
Window.open shows the cached version of the page ONLY if the URL requested matches the cached page URL. The best option is to change the URL every time you try to use the window.open statement. This can be achieved by two methods:
- Append a dummy queryString with Random value
- Append a dummy queryString with DateTime stamp
Your comments are welcome.
var dt = new Date().toString();
var URLToOpen = 'http://server.com/page1.aspx?TimeStamp=' + dt;
window.open('New Page','',URLToOpen);
0 comments:
Post a Comment