1

I developed the application with angularjs and C program. When API with C program change the data, view should be change. But after refreshing the page also new data is not updating in view.

When I am clearing browser's cache manually, my new data is getting updated in view. So the problem is with cache only.

In solution for this issue, I have added following HTML tags.

        <meta http-equiv="cache-control" content="max-age=0" />
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="cache-control" content="no-store" />
        <meta http-equiv="expires" content="0" />
        <meta http-equiv="expires" content="-1" />
        <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
        <meta http-equiv="pragma" content="no-cache" />

These is working, but sometimes it fails, and again catching the cache data.

So please know, if is there any another solution using AngularJS or JavaScript?

Thanks in advance!

PiyaModi
  • 195
  • 6
  • 20
  • 1
    Possible duplicate of [How to programmatically empty browser cache?](http://stackoverflow.com/questions/8155064/how-to-programmatically-empty-browser-cache) – Abhishek Jun 28 '16 at 11:29
  • Possible duplicate of [Clear the cache in JavaScript](http://stackoverflow.com/questions/1011605/clear-the-cache-in-javascript) – Kevin Hakanson Jun 28 '16 at 11:47
  • is there any dependency which i ll have to add? It is giving error. Uncaught Error: Syntax error, unrecognized expression: html[manifest=saveappoffline.appcache] – PiyaModi Jun 29 '16 at 04:10

1 Answers1

0

The browser will respect the cache time set by the response for that particular asset. Any subsequent GET should look to the cache until the timeout is reached.

Its possible you have click here ignoring this.

Community
  • 1
  • 1