设万维读者为首页 万维读者网 -- 全球华人的精神家园 广告服务 联系我们 关于万维
 
首  页 新  闻 视  频 博  客 论  坛 分类广告 购  物
搜索>> 发表日志 控制面板 个人相册 给我留言
帮助 退出
秋念11的博客  
好雨知时节,当春乃发生。 随风潜入夜,润物细无声。野径云俱黑,江船火独明。 晚看红湿处,花重锦官城。  
https://blog.creaders.net/u/5004/ > 复制 > 收藏本页
我的名片
秋念11
注册日期: 2011-03-30
访问总量: 6,090,871 次
点击查看我的个人资料
Calendar
我的公告栏
最新发布
· 极端反华/减少退税/美国旧车
· 走资派搞去政治化50年,在摧毁这
· 普京原来猪队友?(157) 普京是不
· 大嘴躺赢/互吊胃口/军事突破/蚯
· 美国两党,其实双簧
· 民主党输到裸奔/大骗子到大成功
· 他是人民大救星?
友好链接
分类目录
【deleted】
【英文歌曲】
· 我和我的祖国
· love
· Amazed / Hold On
· angel of the morning / drive m
· 温哥华
· 儿歌:中国不投降
· 有个能人叫马云
· 一个温哥华朋友对郭文贵的政治解
· 利用唱歌反党,是一大发明
· 贝多芬音乐排名
【感想】
· 极端反华/减少退税/美国旧车
· 走资派搞去政治化50年,在摧毁这
· 普京原来猪队友?(157) 普京是不
· 大嘴躺赢/互吊胃口/军事突破/蚯
· 美国两党,其实双簧
· 民主党输到裸奔/大骗子到大成功
· 他是人民大救星?
· 有阶级,没斗争/中国将崩溃/拆散
· 过度女权是中国70年失误/软弱得
· 中国敌国/疯子回归/美国渣男/金
存档目录
11/01/2024 - 11/30/2024
10/01/2024 - 10/31/2024
09/01/2024 - 09/30/2024
08/01/2024 - 08/31/2024
07/01/2024 - 07/31/2024
06/01/2024 - 06/30/2024
05/01/2024 - 05/31/2024
04/01/2024 - 04/30/2024
03/01/2024 - 03/31/2024
02/01/2024 - 02/29/2024
01/01/2024 - 01/31/2024
12/01/2023 - 12/31/2023
11/01/2023 - 11/30/2023
10/01/2023 - 10/31/2023
09/01/2023 - 09/30/2023
08/01/2023 - 08/31/2023
07/01/2023 - 07/31/2023
06/01/2023 - 06/30/2023
05/01/2023 - 05/31/2023
04/01/2023 - 04/30/2023
03/01/2023 - 03/31/2023
02/01/2023 - 02/28/2023
01/01/2023 - 01/31/2023
12/01/2022 - 12/31/2022
11/01/2022 - 11/30/2022
10/01/2022 - 10/31/2022
09/01/2022 - 09/30/2022
08/01/2022 - 08/31/2022
07/01/2022 - 07/31/2022
06/01/2022 - 06/30/2022
05/01/2022 - 05/31/2022
04/01/2022 - 04/30/2022
03/01/2022 - 03/31/2022
02/01/2022 - 02/28/2022
01/01/2022 - 01/31/2022
12/01/2021 - 12/31/2021
11/01/2021 - 11/30/2021
10/01/2021 - 10/31/2021
09/01/2021 - 09/30/2021
08/01/2021 - 08/31/2021
07/01/2021 - 07/31/2021
06/01/2021 - 06/30/2021
05/01/2021 - 05/31/2021
04/01/2021 - 04/30/2021
03/01/2021 - 03/31/2021
02/01/2021 - 02/28/2021
01/01/2021 - 01/31/2021
12/01/2020 - 12/31/2020
11/01/2020 - 11/30/2020
10/01/2020 - 10/31/2020
09/01/2020 - 09/30/2020
08/01/2020 - 08/31/2020
07/01/2020 - 07/31/2020
06/01/2020 - 06/30/2020
05/01/2020 - 05/31/2020
04/01/2020 - 04/30/2020
03/01/2020 - 03/31/2020
02/01/2020 - 02/29/2020
01/01/2020 - 01/31/2020
12/01/2019 - 12/31/2019
11/01/2019 - 11/30/2019
10/01/2019 - 10/31/2019
09/01/2019 - 09/30/2019
08/01/2019 - 08/31/2019
07/01/2019 - 07/31/2019
06/01/2019 - 06/30/2019
05/01/2019 - 05/31/2019
04/01/2019 - 04/30/2019
03/01/2019 - 03/31/2019
02/01/2019 - 02/28/2019
01/01/2019 - 01/31/2019
12/01/2018 - 12/31/2018
11/01/2018 - 11/30/2018
10/01/2018 - 10/31/2018
09/01/2018 - 09/30/2018
08/01/2018 - 08/31/2018
07/01/2018 - 07/31/2018
06/01/2018 - 06/30/2018
05/01/2018 - 05/31/2018
04/01/2018 - 04/30/2018
03/01/2018 - 03/31/2018
02/01/2018 - 02/28/2018
01/01/2018 - 01/31/2018
12/01/2017 - 12/31/2017
11/01/2017 - 11/30/2017
10/01/2017 - 10/31/2017
09/01/2017 - 09/30/2017
08/01/2017 - 08/31/2017
07/01/2017 - 07/31/2017
06/01/2017 - 06/30/2017
05/01/2017 - 05/31/2017
04/01/2017 - 04/30/2017
03/01/2017 - 03/31/2017
02/01/2017 - 02/28/2017
01/01/2017 - 01/31/2017
12/01/2016 - 12/31/2016
11/01/2016 - 11/30/2016
10/01/2016 - 10/31/2016
09/01/2016 - 09/30/2016
08/01/2016 - 08/31/2016
07/01/2016 - 07/31/2016
06/01/2016 - 06/30/2016
05/01/2016 - 05/31/2016
04/01/2016 - 04/30/2016
03/01/2016 - 03/31/2016
02/01/2016 - 02/29/2016
01/01/2016 - 01/31/2016
12/01/2015 - 12/31/2015
11/01/2015 - 11/30/2015
10/01/2015 - 10/31/2015
09/01/2015 - 09/30/2015
08/01/2015 - 08/31/2015
07/01/2015 - 07/31/2015
06/01/2015 - 06/30/2015
05/01/2015 - 05/31/2015
04/01/2015 - 04/30/2015
03/01/2015 - 03/31/2015
02/01/2015 - 02/28/2015
01/01/2015 - 01/31/2015
12/01/2014 - 12/31/2014
11/01/2014 - 11/30/2014
10/01/2014 - 10/31/2014
09/01/2014 - 09/30/2014
08/01/2014 - 08/31/2014
07/01/2014 - 07/31/2014
06/01/2014 - 06/30/2014
05/01/2014 - 05/31/2014
04/01/2014 - 04/30/2014
03/01/2014 - 03/31/2014
01/01/2014 - 01/31/2014
12/01/2013 - 12/31/2013
11/01/2013 - 11/30/2013
10/01/2013 - 10/31/2013
09/01/2013 - 09/30/2013
08/01/2013 - 08/31/2013
07/01/2013 - 07/31/2013
06/01/2013 - 06/30/2013
05/01/2013 - 05/31/2013
04/01/2013 - 04/30/2013
03/01/2013 - 03/31/2013
02/01/2013 - 02/28/2013
01/01/2013 - 01/31/2013
12/01/2012 - 12/31/2012
11/01/2012 - 11/30/2012
10/01/2012 - 10/31/2012
09/01/2012 - 09/30/2012
08/01/2012 - 08/31/2012
07/01/2012 - 07/31/2012
06/01/2012 - 06/30/2012
05/01/2012 - 05/31/2012
04/01/2012 - 04/30/2012
03/01/2012 - 03/31/2012
02/01/2012 - 02/29/2012
01/01/2012 - 01/31/2012
12/01/2011 - 12/31/2011
11/01/2011 - 11/30/2011
10/01/2011 - 10/31/2011
09/01/2011 - 09/30/2011
08/01/2011 - 08/31/2011
07/01/2011 - 07/31/2011
06/01/2011 - 06/30/2011
05/01/2011 - 05/31/2011
发表评论
作者:
用户名: 密码: 您还不是博客/论坛用户?现在就注册!
     
评论:
22 Methods of Page Accelerate Technology
   

Readers: web programmers, front-end developers.


An important issue currently for Web applications is page loading speed. If let people wait for a long time, they may feel uncomfortable and give up this site.


Page accelerate technology is to solve above issue and it is an important part of WPO (Web performance optimization) .


Generally, only the mobile devices have the issue because the desktop usually is very strong. However, most those methods may be used for desktop as well.


There are three related fields mobiles are obviously weak: CPU speed, network speed(or bandwidth), and memory. Memory limitation may cause problems when the page is using large amount of data, or large programs, or poor programming style, such as memory leaking. And as the results, that browser may collapse instead of slow down the page loading.


Really affecting the page loading speed are CPU, and network access. Particularly, the latter.


As a front-end or Web developer, we may reduce the burden on the network speed and CPU to improve page loading speed by below methods.


1)    Using external links for library, either CSS or JS since likely, they will be cached later instead of copying the contents directly inside the page(online).


2)    Using external links from CDN(Content Delivery Networks). It may help since they would be easily cached. Besides, the CDN site may be close to the users than your site.


3)    Merging as many files as possible to only one file for CSS and JS respectively. That can reduce HTTP calls.


4)    Uing minimum size files for CSS and JS, such as removing space and using ‘min’ file for JS.



5)    DNS translating IP address costs time so you may directly use the IP address for the links. Of course, you may still use the CDN display string for links displayed on the pages.


6)     HTTPS uses up a lot of resources so if possible, using HTTP, but implemening SSL for the important part, such as using HTTPS for AJAX.


7)    Using LocalStorage for bigger files and using cookies to store the names of files.


8)    Using front-end DB such as indexDB, and storing whole system/results on LocalStorage.


9)    Using catch for your HTML pages, in HTML5, it is straightforward and easily(.appcache). But also, you may need to set up/update expires in the header of the HTML pages.


10)  If possible, avoiding JS framework and library since they would not speed up the perfomance speed but cost source. Personally, I think jQuery is OK. However, for jQuery, you have to notice that a) not using selectors too broad, otherwise, too many tags would be used that would be costing. B) jQuery is automatic loops, so if not careful, the code would be wasting sources for too much loops.


11)  Using gzip to compress files for both text and binary.


12)  Avoiding using too many cookies which costs communication between client and server.


13)  For images, using JPG which is saving in size instead of other image formats.


14)  Using CSS3 sprites/translate tech --- using/downloading a big image and shift/viewport on a part on it according to requirement from program, instead of using multiple smaller images which needing multiple links.


15)  If possible, using HTML code and CSS code as much as possible, instead of using JavaScript. Forfunately, HTML5/CSS3 gives us more possibility for it. For example, for many light dynamic display, we may implement CSS class/psedoclasses. And in HTML5, there are many more powerful HTML tags, such as “range”,”date”,”progress”, which used to be made from JavaScript.

This, plus 14), meaning that for some simple animation we may not need JavaScript.


16)  JS script don’t need to work until the page loaded(display finished), so JS script/library should be placed after the HTML part is displayed. Dynamic CSS script has the similar issue but for static CSS part, it should be put inside header link or inline.


17)  Making pages as much static as possible. Doing as less back-end process as possible. For example, after login, the page would be the same to anyone. So the back-end code only needs to pick up information related to this particular user. And if the picking up would be time consuming(that is not good design already), you may load the page first and finally attached an external JS for the information of this guy. In short, any information pre-known before the next page calling, the server should prepare as much static as possible for pages. And of course, no redirection. This method may be the most important and need a bit high programming skills.


18)  Using cache in ajax.


19)  Using HTML web workers for multiple threats of JavaScript. The developer may need to carefully separate/distribute the JS code for it.


20)  For mobile, many pages in the beginning only display the top part and the user may scrolling down, so if need to speed up display, developer may design and load the the top part first.


21)  Changing AJAX to WbSocket which is a little faster. However, the change not only causes code changed in the front-end, but also you have to add a lot complex program on back-end.


22)  In JavaScript, doing smart programming, such as avoiding repeating some source costing call such “this” , so you can copy it to a variable like $this, smart strings concatenation, and some events such as resize, touchmove, one act may cause many events, so the code must smart enough to avoid all unnecessary event process. Besides, in binding event handler, don’t forget to unbind old one which may not cause bugs, but wasting sources. Finally, avoiding alert windows(and other pop HTML windows unless necessary), intead, using CSS windows, only cost less sources, but also, less annoying and easier to remove(after a while, or any touch event).

 
关于本站 | 广告服务 | 联系我们 | 招聘信息 | 网站导航 | 隐私保护
Copyright (C) 1998-2024. Creaders.NET. All Rights Reserved.