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!

3
  • 1
    Possible duplicate of How to programmatically empty browser cache? Commented Jun 28, 2016 at 11:29
  • Possible duplicate of Clear the cache in JavaScript Commented Jun 28, 2016 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] Commented Jun 29, 2016 at 4:10

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I ll do this, but what client will do!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.