Comments (8)
@classicemi 可以参考一下 https://github.com/mtjs/mt
我觉得相对于功能上对标浏览器缓存与 http 304, 增量更新
才是真正的杀手级的 feature
。毕竟 浏览器缓存失效
与 用户清空
缓存都只能算是 edge case,而增量更新
则是目前前端生态普遍的需求。
from bowl.
http://zhihu.com/question/28467444/answer/41148739
ls 和本地缓存比毫无优势。不过可能
(没有做过测试)在弱网的移动设备上有点优势
from bowl.
@ZheFeng
根据你的截图,from memory cache 表示的是资源命中了强缓存这是根据资源的 http header 来判断的,包括 Expires
和 Cache-Control
这两种 header,在这种情况下,浏览器缓存的效果是最好的,都没有之一。
需要发送请求确认资源是否过期的是协商缓存,是另一种浏览器缓存,相比于强缓存,受客户端缓存未及时更新的影响较小(因为毕竟要向服务器确认一次),所以它的应用更灵活一点,我在 FAQ 中指的实际上是这种缓存方式,没有说清楚和强缓存的区别,是我的疏忽。
就像上面的回复提到的一样,利用 LS 缓存有它的局限性,也有它的优势,从目前的情况来看确实优势并不明显,但这里更多的是对使用这种思路来做缓存的一个探索,后面会给 bowl 增加更多实用的功能,不会只局限于简单的 LS 缓存。
from bowl.
关于这个问题以及以后要做的事情,中文文档里更新了 FAQ 部分可以看下。
https://elemefe.github.io/bowl/zh-cn
from bowl.
看了更新的FAQ
浏览器的缓存并不可靠,用户有可能关闭缓存或手动清除缓存,另外即使有缓存每次还是要向服务器发送请求确认资源是否过期,bowl 可以完全控制这一环节,也不会发送任何请求。
其中对于
缓存每次还是要向服务器发送请求确认资源是否过期
并不认同,你看我的截图就知道是不向服务器发请求的,这个是可以控制的。截图里显示延迟是 0ms。
from bowl.
@classicemi 谢谢,强烈支持这个勇于探索的精神。
并且利用LS对于代码升级,版本迭代会有非常好的效果。这种探索是很有实际意义的。
from bowl.
+1
from bowl.
@Brooooooklyn 谢谢,很有参考价值,这方面已经着手在做了
from bowl.
Related Issues (14)
- 能否和 webpack 结合使用 HOT 1
- 跟cooking能配套用吗 HOT 2
- 有点酸 HOT 3
- 执行顺序 HOT 1
- Documentation 中的md格式貌似不能被正常解析 HOT 1
- 支持跨域么? HOT 1
- js的文件内容被篡改(运营商劫持),而又被localStorage存储了,怎么处理? HOT 1
- 第一次加载如果文件存在依赖关系会报错
- findIndex在最新版的QQ浏览器中不支持
- babel生效了吗?
- chrome 网络限制为GPRS(500ms,50kb/s,20kb/s)下加载网页,报错
- 这个貌似和requirejs有冲突!
- 这个和Cache-Control有什么区别呢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bowl.