Why offline first?

Imagin you are visiting a website, it is fine if wifi connection is good. It might be also "fine" if show you "Your don't have internet connection", so you give up. The worse case is you have really poor wifi connection and the page is trying to loading, but nothing comes up. So you just wait and wait...

Noramlly online first soultion is trying to connect network (server) first. If cannot connect then fetch data from cache. This is not so good, because you still need to wait and wait util network fallback then you will get cache data. How about we do:

  1. When page loading, send two request.
  2. One request going to cache to fetch as much as we can to display on the screen.
  3. Another reqest going to the reall server, get data update.
  4. If we are in really poor wifi connection, at least we get something, we see something, better than nothing.
  5. If the connection is good, the cache data will be replaced with real data and interface update immediately. This will provide a better user experence.

[PWA] 0. Introduce to Offline First的更多相关文章

  1. how to use panda

    0.Introduce pandas.read_csv(filepath_or_buffer,sep=', ', dialect=None, compression='infer', doublequ ...

  2. Project Server 2016 部署

    问题: 手动创建网站集后,激活Project的功能时候报错 Only Administrator users can obtain the connection string for [Admin] ...

  3. Python黑帽编程 3.2 ARP监控

    Python黑帽编程 3.2 ARP监控 在第3.1节<ARP欺骗>中,我们学习了ARP的基本原理,使用Python实现了我们自己的ARP欺骗工具.在上一节的基础上,我们来实现一个ARP监 ...

  4. Python黑客编程ARP欺骗

    Python灰帽编程 3.1 ARP欺骗 ARP欺骗是一种在局域网中常用的攻击手段,目的是让局域网中指定的(或全部)的目标机器的数据包都通过攻击者主机进行转发,是实现中间人攻击的常用手段,从而实现数据 ...

  5. Python黑客编程基础3网络数据监听和过滤

    网络数据监听和过滤 课程的实验环境如下: •      操作系统:kali Linux 2.0 •      编程工具:Wing IDE •      Python版本:2.7.9 •      涉及 ...

  6. DedeCMSV57数据库结构文档

        表名:dede_addonarticle(ENGINE=MyISAM/CHARSET=gbk) 说明:Top 字段名 说明描述 具体参数 aid 文章ID mediumint(8) unsig ...

  7. Oracle - PL/SQL Commands

    第一章:日志管理 1.forcing log switches sql> alter system switch logfile; 2.forcing checkpoints sql> a ...

  8. 常用ASP函数的封装

    做ASP开发常常需要用到一些小功能,这些功能通常我们都会封装成函数来使用,本教程提供了许多我们经常用到的ASP函数. <% '所有功能函数名如下: ' StrLength(str) 取得字符串长 ...

  9. javascript版QQ在线聊天挂件

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. iOS 数据持久性存储-属性列表

    iOS上常用四种数据存取方法有: 1.属性列表 2.对象归档 3.iOS的嵌入式关系数据库(SQLite3) 4.苹果公司提供持久性共聚Core Data 由于苹果公司的沙盒机制,每个应用程序都有自己 ...

  2. 自构BeanHandler(用BeansUtils)

    class BeanHandler<T> implements ResultSetHandler<T>{ private Class<T> clazz; publi ...

  3. WebDriverWait 中 and, or, not用法

    1. And 用法 wait.until(ExpectedConditions.and( ExpectedConditions.visibilityOfAllElementsLocatedBy(By. ...

  4. iPhone、iPad默认按钮样式问题

    iPhone.iPad默认按钮样式问题 解决方法给按钮元素添加一个-webkit-appearance: none;具体代码 input[type="button"], input ...

  5. select控件变成可输入状态

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. C#【数据库】 Access类

    using System; using System.Data; using System.Data.OleDb; namespace AccessDb { /**//// <summary&g ...

  7. IOS开发备忘

    1. ios 真机调试时出现CopyPngFile error解决方法 说是读取的时候没有找到这张图片,检查了一下图片路径,没有问题,于是google之,找到两种解决方法 : 方法一:在build s ...

  8. 使用Python操作Redis

    1. 安装pyredis 首先安装pip   1 2 3 4 5 6 7 8 <SHELL># apt-get install python-pip ...... <SHELL> ...

  9. NameNode元数据的管理机制(三)

    元数据的管理: 第一步:客户端通过DistributedFilesystem 对象中的creat()方法来创建文件,此时,RPC会 通过一个RPC链接协议来调用namenode,并在命名空间中创建一个 ...

  10. C# 改变图片尺寸(压缩),Image Resize

    /// <summary> /// Resize image with a directory as source /// </summary> /// <param n ...