Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

All the ajax calls that are sent from the IE are cached by Angular and I get a 304 response for all the subsequent calls. Though the request is the same, the response is not gonna be the same in my case. I want to disable this cache. I tried adding the cache attribute to $http.get but still, it didn't help. How can this issue be resolved?

1 Answer

0 votes
by (106k points)
edited by

To resolve this issue you can either append a unique query string to the request.

$http({ 

url: '...', 

params: { 'foobar': new Date().getTime() } 

})

If you have access to the server, then you can make sure that necessary headers are set to prevent caching. If you're using ASP.NET MVC this answer might help.

Go for this in-depth job-oriented Angular Certification Course!

Related questions

0 votes
1 answer
0 votes
1 answer
asked Aug 30, 2019 in Web Technology by Sammy (47.6k points)
+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 29, 2019 in Web Technology by Sammy (47.6k points)

Browse Categories

...