Thank you for your input,
still even after changing and playing a little bit with repositioning
of the setHeader lines, the problem persists. The only solution I found
so far is ,shut down the browser and restart the browser, then only
the browser is not asking to store the file or writing the cached results directly in the browser.
Is there any solution, without closing the browser that will prevent the writing or prompting to save the cached results when user cancelled the prompted dialog box?