[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)论文. 笔者翻译了该论文.由于时 ...
随机推荐
- git拉取远端改变,但是不覆盖本地的修改
1.git stash 2.git fetch weixin-old-remote 3.git rebase weixin-old-remote/main151028_wxpay_main15100 ...
- Drainage Ditches(网络流(EK算法))
计算最大流,EK算法模板题. #include <stdio.h> #include <string.h> #include <queue> using names ...
- C# 处理oralce 时间
addWorkSql.Append("to_date(' " + DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm") + ...
- css 继承性和层叠性
css有两大特性:继承性和层叠性 继承性 面向对象语言都会存在继承的概念,在面向对象语言中,继承的特点:继承了父类的属性和方法.那么我们现在主要研究css,css就是在设置属性的.不会牵扯到方法的层面 ...
- itext 生成doc文档 小结(自己备忘)
1.引入maven <dependency> <groupId>com.lowagie</groupId> <artifactId>itext</ ...
- G - Wrong Subtraction
Problem description Little girl Tanya is learning how to decrease a number by one, but she does it w ...
- Java 类加载器及加载Class字节码
参考来源:http://www.cnblogs.com/fingerboy/p/5456371.html java笔记--理解java类加载器以及ClassLoader类 参考来源:htt ...
- SQLServer2008 在where条件中使用CASE WHEN
create table #temp( id int identity(1,1), name varchar(20), startYear int, startMonth in ...
- Serializable资料整理
1. 序列化 简单的说就是为了保存 内存中各种对象的状态(是实例变量,不是方法),并且可以把保存的对象读取出来. 虽然保存 object states的方法很多,但是Java提供了一种保存对象状态的机 ...
- Java基础13一异常
1.异常概念 异常是程序在运行期发生的不正常的事件,它会打断指令的正常执行流程. 设计良好的程序应该在异常发生时提供处理这些不正常事件的方法,使程序不会因为异常的发生而阻断或产生不可预见的结果. Ja ...