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.
Yves MelletAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

samtran0331Commented:
I had an issue with this even in IE6....one way around it...that works really consistently...is when you do the export, and set the filename of the pdf, add a random number to the end of the file name, or I used the full date (including date,hours, minutes,seconds, milliseconds). so it would go from:
filename.pdf

to something like:
filename_200802060819105.pdf

...that way, the files in the user's browser cache won't ever be the same filename...
0
Yves MelletAuthor Commented:
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.
0
mlmccCommented:
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
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Yves MelletAuthor Commented:
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.
0
samtran0331Commented:
>>I think it is still ie trying to run the cache instead of the actual report it is told to open.

One way to confirm for absolute sure is
1. run the report.
2. clear the browser cache
3. run the report again.

if you do see the new report data, then it is definitely the user's browser cache.
As a web application, you won't be able to have control over the client's browser and do things like enable/disable their cache.
No amount of changing IIS settings can change this because it is on the client machine, not the web server...

But as in my first suggestion, if you force a unique filename every time...instead of the date, you could even attach a full GUID or something... the client's browser cache will have to serve the file because it should never exist twice in their cache.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Yves MelletAuthor Commented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.