简体   繁体   中英

IE shows a previously cached version of my page

my scenario is this; the user selects the list of reports they wish to print, once they select and click on the a button, i open up another page with the selected reports ready for printing. I am using a session variable to pass reports from one page to another.

first time you try it, it works fine, second time you try it, it opens the report window with the previous selected reports. I have to refresh the page to make sure it loads the latest selections.

is there a way to get the latest value from the session every time you use it? or is there a better way to solve this problem. open for suggestions...

Thanks

C# Asp.net, IE&7 /IE 8

After doing some more checking maybe if you check out COMET it might help. The idea is that you can have code in your second page which will keep checking the server for updated values every few seconds and if it finds updated values it will refresh itself.

There are 2 very good links explaining the imlementation.

The first link explains what COMET is and how it ties in with ASP.NET, the second link has an example using a chat room. However, I'm sure the code querying for updates will be pretty generic and can be applied to your scenario.

I have never implemented COMET yet so I'm not sure how complex it is or if it is easy to implement into your solution.

Maybe someone developing the SO application is able to resolve this issue for you. SO uses some real-time feature for the notifications on a page, ie: You are in the middle of writing an answer and a message pops up in your client letting you know someone else has added an answer and to click "here" to refresh.

It's better to use URL paramaters. So you have a view of value of the paramaters.

The proper fix is to set the caching directives on the HTTP response correctly, so that the cached response is not reused without validation from the server.

When you fail to specify the cache lifetime, the client has to "guess" how long the response is good for, and the browser's guess probably isn't what you want. See http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM