angular.js - angular caching problem
天蓬老师
天蓬老师 2017-05-15 16:56:50
0
2
522

$http.get('http://server/myapi', {

cache: true  

}).success(function() {//Processing success});

$http.get added a cache. I requested records. The first time I requested the data on the URL, I refreshed it many times and never requested data again. . What is the update mechanism for cache here? Under what circumstances can the data on the website be obtained again?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
黄舟

Generally, I recommend AngularCache
https://github.com/jmdobry/angular-cache

Can be set to expire by time

大家讲道理

Save cache

var $httpDefaultCache = $cacheFactory.get('$http');

Then you can control
$httpDefaultCache.remove(key);
// key is your url such as /api/user/current/51a9020d91799f1e9b8db12f

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template