简体   繁体   English

Sencha Touch 大 html 渲染速度慢

[英]Sencha Touch large html rendering is slow

we build a Sencha Touch application, which allows to search and display html documents.我们构建了一个 Sencha Touch 应用程序,它允许搜索和显示 html 个文档。 Nothing special, simple html document which user can scroll up and down.没什么特别的,简单的 html 文档,用户可以上下滚动。

Some of the documents are pretty big ~ 5mb of pure html. These documents slow down the application, sometimes it even crashes.有些文件很大~ 5mb 纯 html。这些文件减慢了应用程序,有时甚至崩溃。

Do you have any ideas how to fix this?你知道如何解决这个问题吗?

5mb-size HTML file is very large, even for laptop browser. 5mb 大小的 HTML 文件非常大,即使对于笔记本电脑浏览器也是如此。 If you run it on mobile devices browsers than there's a very high probability that they will be crashed.如果您在移动设备浏览器上运行它,它们很可能会崩溃。 (Nearly 100% for BlackBerry browsers.) (BlackBerry 浏览器接近 100%。)

It's highly recommended that you should keep the size of each HTML file not exceed several hundred KBs (let's say 500KB).强烈建议您应保持每个 HTML 文件的大小不超过数百 KB(假设为 500KB)。 Then in each of your HTML files, provide "Read more" button for the users to navigate to the next chapter of your HTML content.然后在您的每个 HTML 文件中,为用户提供“阅读更多”按钮以导航到您的 HTML 内容的下一章。

Please keep in mind that, the more complex the DOM is, the slower your Sencha Touch application will become, as it always has to completely manage your DOM structure.请记住,DOM 越复杂,您的 Sencha Touch 应用程序就会变得越慢,因为它总是必须完全管理您的 DOM 结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM