angular的缓存机制

缓存数据,不仅能使数据得到存储,而且使项目能进行客观的性能优化。

$http的缓存

$http({
     method: 'GET',
     url: 'api/user.json',
     cache: true
})

缓存能够服务的请求越多,整体系统性能就能提升越多。

自定义请求

$http({
     method: 'GET',
     url: 'api/user.json',
     cache: myCache
})


猜你喜欢

转载自blog.csdn.net/xieyixiao_123/article/details/77816491