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. arm Linux 系统调用过程

    系统调用是操作系统提供给用户(应用程序)的一组接口,每个系统调用都有一个对应的系统调用函数来完成相应的工作.用户通过这个接口向操作系统申请服务,如访问硬件,管理进程等等.但是因为用户程序运行在用户空间 ...

  2. 【随记】解决:VS2010 调试器无法继续继续运行该进程,无法启动调试

    今天在调试项目的时候突然出现错误: 按照网上的一些方法弄了后还是同样报错,把本地代码删除后从库上重现拉下来的项目依然报错,到这里就明白不是项目本身问题了,而是VS2010 的问题,经过网上查资料,问同 ...

  3. Cookie的基本使用

    1, 如何创建cookie <?php //创建cookie信息 //这个函数用于保存cookie //第一个参数,表示cookie一个key,第二个表示val,第三个表示cookie值,在客户 ...

  4. magento后台 Fatal error: Call to a member function getId() on a non-object in错误

    后台分类管理出现错误 Fatal error: Call to a member function getId() on a non-object in 在数据库中运行以下sql语句 INSERT I ...

  5. dede列表标签递增数字生成

    今天给人家调试程序,用到[field:global name=autoindex/ ] 调用指定频道.而频道前面需要加CSS代码,CSS代码正好是按序号排列的 忽然发现,是从0开始. 于是修改了一下代 ...

  6. ubuntu下使用C语言开发一个cgi程序

    主要步骤是: 1. 开发一个C程序(在标准输出中输出HTML字符串) 2. 复制到apache2的cgi-bin目录去 3. 在httpd.conf中开启cgi功能(我似乎没用到,也可以使用cgi) ...

  7. Solr4.8.0源码分析(22)之SolrCloud的Recovery策略(三)

    Solr4.8.0源码分析(22)之SolrCloud的Recovery策略(三) 本文是SolrCloud的Recovery策略系列的第三篇文章,前面两篇主要介绍了Recovery的总体流程,以及P ...

  8. Sphnix创建文档

    http://www.ibm.com/developerworks/cn/opensource/os-sphinx-documentation/ Oracle实例名和服务名

  9. ajax异步请求不能刷新数据的问题

    搞了两三天的问题,今天解决了.总结下: function reportGrpChange(cuid, title){ document.getElementById('reportFrameDiv') ...

  10. Lucky and Good Months by Gregorian Calendar(模拟)

    http://poj.org/problem?id=3393 好大的一道模拟题,直接当阅读理解看了.下面是大神写的题意,解释的好详细. 定义: Goog month : 该月第一个工作日为星期一的月份 ...