今天遇到iphone上webkit的缓存问题,查到老外的一篇文章,感觉非常不错,转过来分享。
原文链接:http://www.yuiblog.com/blog/2010/06/28/mobile-browser-cache-limits/
下面是部分摘录:
1.Android
The Android browser exhibited the best cache behavior of all devices tested. While it appears to impose no limit on the size of individual components, the total cache size seems to be limited to approximately 2MB, which means that individual components are effectively limited to 2MB as well.
The page cache appeared to impose no limit on the size of individual pages, happily caching every byte I threw at it until the available RAM was exhausted and the browser crashed.
I was pleasantly surprised to find that Android’s component cache survived both browser restarts and power cycles, a feat none of the iOS devices was able to match.
Possible caveat: A review of Android’s WebKit source tree leads me to believe that its cache limits may adapt based on the amount of RAM and/or flash memory available on the particular device on which it’s running. If true, these numbers may only be applicable to the Nexus One. In fact, if the cache size adapts based on unused memory rather than total memory, these numbers may only be applicable to my Nexus One.
I could be mistaken, but the differences in the iOS 4.0 test results on the iPhone 3GS and iPhone 4 support this theory. (Android and Mobile Safari are both WebKit-based browsers, so they may have this behavior in common.) If you’re familiar with the WebKit source and can shed more light on this, please get in touch with me.
2.iOS
Results varied wildly across the three most recent versions of iOS. Astonishingly, Mobile Safari on iOS 3.1.3 did not cache components of any size, despite having an apparently unlimited page cache size. This is troubling since it means iOS 3.1.3 users are likely getting a suboptimal browsing experience, especially if they aren’t using wifi. The unlimited page cache size does little good here, since it only comes into play for back/forward navigations. This behavior is a significant change from what others observed in previous iOS releases and I can’t imagine any good reason for it, so I suspect this may be a bug.
Mobile Safari on iOS 3.2 (which is only available on the iPad) does not exhibit this bug. Its 25.6KB component limit and ~281.6KB total cache limit are better than nothing, but they still seem paltry compared to the other devices tested. Uniquely among iOS devices, the iPad appears to limit the size of pages in the page cache to 25.6KB, the same as its component size limit.
Mobile Safari on iOS 4.0 exhibited different limits on the iPhone 3GS and on the iPhone 4, which implies that the limits adapt based on available RAM (the iPhone 3GS has 256MB while the iPhone 4 has 512MB; both devices tested had 32GB of flash memory). On the iPhone 3GS, iOS 4.0 has a 51.199KB component size limit and a ~1.05MB total component cache size.
On the iPhone 4, the component size limit was almost exactly two times the limit on the iPhone 3GS, at 102.399KB. The total component cache size was approximately 1.9MB. Perhaps because iOS 3.2 and iOS 4.0 were developed separately but branched from a common ancestor, the iOS 4.0 page cache size appears to be limited only by available RAM on both devices tested, just like iOS 3.1.3.
None of the iOS devices preserved the contents of the cache across forced browser restarts or device power cycles, although they did preserve the cache when merely switching applications without actually killing the browser.
分享到:
相关推荐
在windows下安装Mysql系统日志出现max_open_files: 2048 max_connections: 510 table_cache: 764 类似错误是因为 max_connections 最大连接数和max_open_files、table_cache 不匹配。适当的降低max_connections 或...
### iOS7 Programming Pushing the Limits #### 精品iOS开发书籍:内容深入与高端进阶 本书《iOS7 Programming Pushing the Limits》是一本专为iOS开发者设计的专业书籍,旨在帮助开发者掌握iOS7下的高级编程技巧...
《微积分预备》是一本经典的国外教材,全书共1151页,详细讲授了微积分预备课程的知识点,非常适合自学。这本书的涵盖的知识点主要分为以下几个部分: 1. 线性函数(Linear Function) 线性函数的一般形式是f(x)=mx...
##### 2.2 block限制或inode限制 - **inode限制**:主要用于管理用户创建文件的数量,而非文件的实际大小。 - **block限制**:用于管理用户使用的磁盘容量,这是最常见的磁盘配额设置方式。 ##### 2.3 soft/hard...
解压后获得文件:《iOS 7 Programming Pushing the Limits》.pdf 全高清文字版非图片扫描版,完整!! 其中的一些目录: Part I What’s New? C h a p t e r 1 The Brand New Stuff The New UI …… Enhancements to...
lua-resty-limits 基于openresty每秒钟限制nginx请求 使用示例 local limits = require ... limits: reqs_per_range (ngx. var . binary_remote_addr , ngx. var . uri , 1 , 2 )) 由提供 如有任何疑问,请告诉我。
天火浏览器 当前版本:v4.0.4 大小 2.71MB 一款让你的 iPad 支持 Flash 的浏览器,这样您就可以直接使用 iPad 来观看 Flash 视频网站了,但是遗憾的是,Flash 游戏就不支持啦,作者说,iPad 上已经有足够多的...
标题《iOS 6 Programming Pushing the Limits》明确指出了书籍的内容定位——旨在推动读者对Apple iPhone、iPad和iPod Touch应用程序开发的技能极限。作者是Rob Napier和Mugunth Kumar,由John Wiley & Sons, Ltd....
《Fundamental Limits of Caching》这篇文献深入探讨了编码缓存的理论基础和其性能上限。 图像2和图像3可能展示了编码缓存系统的基本工作原理和性能分析。在这些图中,我们可能会看到以下几个关键知识点: 1. **...
2. **后台限制(Background Execution Limits)**:为了延长电池寿命和提高系统性能,Android 8.0对后台应用的执行进行了限制。包括限制后台服务的启动、限制BroadcastReceiver的使用以及限制后台位置更新等,这对...
However, due to standard specification of W3C of HTML5 hasn't been drafted, and browser-alike webview in android has several limits itself, there are still many problems to be solved. Including: (1) ...
3. **Background Execution Limits**:为了延长设备电池寿命,Android 8.1对后台应用执行进行了限制。开发者需要调整服务、BroadcastReceiver和定时任务的使用方式,确保它们在限制条件下仍能正常工作。 4. **...
管理系统限制的Ansible角色。 变数 limits_enabled : yes limits_path : /etc/security/limits.d/tune.conf # See http://linux.die.net/man/5/limits.conf for description limits_limits : - " * - nofile 65535...
标题中提到的“Energy-efficient timetable and speed profile optimization with multi-phase speed limits: Theoretical analysis and application”(节能时间表和多相限速下的速度曲线优化:理论分析与应用)...
iOS.5.Programming.Pushing.the.Limits.Developing.Extraordinary.Mobile.Apps.for.Apple.iPhone.iPad.and.iPod.Touch.Wiley
In iOS Application Security, mobile security expert David Thiel reveals common iOS coding mistakes that create serious security problems and shows you how to find and fix them. After a crash course ...