[Angular] Performance Caching Policy - Cache First, Network Last
If you want to cache API response by using angular service-worker, you can do it in:
src/ngsw-config.json:
{
"index": "/index.html",
"assetGroups": [{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html"
],
"versionedFiles": [
"/*.bundle.css",
"/*.bundle.js",
"/*.chunk.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}],
// cache for API data
"dataGroups": [
{
"name": "lessons-api",
"urls": [
"/api/lessons"
],
"cacheConfig": {
"strategy": "performance", // cache first, network last
"maxAge": "1d",
"maxSize":
}
}
]
}
[Angular] Performance Caching Policy - Cache First, Network Last的更多相关文章
- [Angular] Freshness Caching Policy - Network First, Cache Last
In some cases, you want to get fresh data instead of cache data to the screen, such as stock applica ...
- [中英对照]Why Redis beats Memcached for caching | 在cache化方面,为何Redis胜过Memcached?
对Memcached和Redis有兴趣的同学不妨花几分钟读一读本文,否则请飘过. Why Redis beats Memcached for caching | 在cache化方面,为何Redis胜过 ...
- asp.net core 系列之Reponse caching之cache in-memory (2)
这篇文章(主要翻译于官网,水平有限,见谅)讲解asp.net core 中的 Cache in-memory (内存缓存). Cache in-memory in ASP.NET Core Cachi ...
- 服务器主机上RAID Card的Write Caching Policy
在Cisco Server的DRAC中, 创建virtual drive时, 会看到下面的选项. 那么Write back, write through, write back bad BBU之间 ...
- Performance tuning library cache lock & single-task message
My colleague suddenly encountered a problem today,a Database becomes very slow , and the a lot of se ...
- 实践 Network Policy - 每天5分钟玩转 Docker 容器技术(172)
为了演示 Network Policy,我们先部署一个 httpd 应用,其配置文件 httpd.yaml 为: httpd 有三个副本,通过 NodePort 类型的 Service 对外提供服务. ...
- 实践 Network Policy 【转】
为了演示 Network Policy,我们先部署一个 httpd 应用,其配置文件 httpd.yaml 为: httpd 有三个副本,通过 NodePort 类型的 Service 对外提供服务. ...
- Chapter 6 — Improving ASP.NET Performance
https://msdn.microsoft.com/en-us/library/ff647787.aspx Retired Content This content is outdated and ...
- CABaRet: Leveraging Recommendation Systems for Mobile Edge Caching
CABaRet:利用推荐系统进行移动边缘缓存 本文为SIGCOMM 2018 Workshop (Mobile Edge Communications, MECOMM)论文. 笔者翻译了该论文.由于时 ...
随机推荐
- PCB拼板之单一矩形排样算法
算法实现相关内容整理如下: 一.排样变量与关系 此算法,基于固定4边的尺寸遍历每个单只板的长宽得到最优解. 二.条件约束 基本约束条件(参考上图变量) 三.排样图形相同类型规律 由于计算量大,为了有效 ...
- B. Sereja and Suffixes(cf)
http://codeforces.com/problemset/problem/368/B B. Sereja and Suffixes time limit per test 1 second m ...
- 七牛php上传下载类,集成官方文档的方法
<?phpuse Qiniu\Auth;use Qiniu\Storage\UploadManager;class qiniu{ public $_accesskey = null; publi ...
- 从0开始学习BFC
为什么需要BFC? <style> .red { background: red; } .blue { background: #1890ff; } .green { background ...
- Django day04 路由控制
Django请求的整个的生命周期 Django中路由控制的作用: 一: 简单配置 url 是一个函数 -第一个参数是正则表达式(如果要精确匹配:'^publish'/$ 以^开头,以$结尾) -第二个 ...
- UIView动画基础
1 Position 平移 [UIView animateWithDuration:1.0 animations:^{ _blueView.centerX = self.view.width -100 ...
- 7.union
联合结果集union 简单的结果集联合: select number,name,age from emp union select cardnumber,name,age from emp2 基本的原 ...
- poj2376 Cleaning Shifts 区间贪心
题目大意: (不说牛了) 给出n个区间,选出个数最少的区间来覆盖区间[1,t].n,t都是给出的. 题目中默认情况是[1,x],[x+1,t]也是可以的.也就是两个相邻的区间之间可以是小区间的右端与大 ...
- Inception搭建
Inception安装Inception是集审核.执行.回滚于一体的一个自动化运维系统,它是根据MySQL代码修改过来的,用它可以很明确的,详细的,准确的审核MySQL的SQL语句,它的工作模式和My ...
- Android:JAVA使用HDF5存储
Hierarchical Data Format,可以存储不同类型的图像和数码数据的文件格式,并且可以在不同类型的机器上传输,同时还有统一处理这种文件格式的函数库.大多数普通计算机都支持这种文件格式. ...