I am having caching issue in IE browser. My web page has download pdf functionality. The server provides the file contents which is then manipulated as a blob object and then inputted to filesaver.js.Each time I download a pdf the older file is being shown. How can I prevent this?
I tried to append random numbers with the file name. Still the cache issue existed.
var pdfFileName ="myfile" + "_" + i; // i=0,1,2,3 etc
var fileName = new Blob([response], {
type: 'application/pdf'
});
saveAs(file, pdfFileName + ".pdf");
Another approach which worked is from IE Settings -> Internet Options -> general tab -> Browsing history - Settings -> Select the option "Every time I visit the webpage". This helped me to eliminate the cache issue.
But I want to know how to handle caching programmatically?