Yves Mellet
asked on
IE7 turn off cache programmatically
I have an web application created in ASP.NET and VB.NET that produces reports in Crystal and then exports them to PDF to be viewed in the browser. The problem I am having is that some users were upgraded to IE7 and now the reports display the same data no matter if the parameters have changed. IE7 is using the cache to display the report with the same data over and over. How can I turn off the cache on the pdf report?
I have "Check for newer versions of store pages" set to Automatically and included the meta tags
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
on the page where the report parameters are passed to no avail.
I have "Check for newer versions of store pages" set to Automatically and included the meta tags
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control"
on the page where the report parameters are passed to no avail.
ASKER
There is no solution for IE7 to turn off the out of date cache?? or turn it off myself with code? I will adopt your solution if there is nothing better. Thank you for responding.
As you generate the report you could force a refresh of the data through a command to the report object
RptObj.Refresh
I don't know exactly how you specify that in ASP.
mlmcc
RptObj.Refresh
I don't know exactly how you specify that in ASP.
mlmcc
ASKER
The application overwrites the previous report which is on the server and opens a new browser windows that points to the new report on the server. But ie uses the report in the cache at the user's box (Temporary Internet Files). No amount of refreshing to the new report could change that since, thanks to the cache, ie picks up the wrong report. If you know maybe how to force a cache refresh or turning off cache for my app would be helpful. I modified IIS in the server in the tab HTTP Headers by checking "Enable Content Expiration" and selecting Expire after 1 minute. That is not ideal because I wish it to give me the option in seconds. If I use the option Expire Immediately the report flickers and does not show at all. I think it is still ie trying to run the cache instead of the actual report it is told to open.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I cleared the browser cache but it returns the same file with the same date of creation. I don't really understand but I will adopt your answer because I know it will work. Thank you
filename.pdf
to something like:
filename_200802060819105.p
...that way, the files in the user's browser cache won't ever be the same filename...