設萬維讀者為首頁 萬維讀者網 -- 全球華人的精神家園 廣告服務 聯繫我們 關於萬維
 
首  頁 新  聞 視  頻 博  客 論  壇 分類廣告 購  物
搜索>> 發表日誌 控制面板 個人相冊 給我留言
幫助 退出
秋念11的博客  
好雨知時節,當春乃發生。 隨風潛入夜,潤物細無聲。野徑雲俱黑,江船火獨明。 晚看紅濕處,花重錦官城。  
https://blog.creaders.net/u/5004/ > 複製 > 收藏本頁
網絡日誌正文
22 Methods of Page Accelerate Technology 2015-03-24 13:26:35

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).

瀏覽(957) (0) 評論(0)
發表評論
我的名片
秋念11
註冊日期: 2011-03-30
訪問總量: 6,836,699 次
點擊查看我的個人資料
Calendar
最新發布
· 加沙委員會看來是在幫以色列打理
· 中國應該如何看待加沙和平委員會
· “斬殺線” 為何讓美國主流媒體急
· 斬殺線
· 重溫列寧的帝國主義論
· 一箭四雕---1 打擊中國 2 石油利
· 新自由主義---資本主義的最後狂
分類目錄
【deleted】
【英文歌曲】
· 你最好的文章,是哪一篇?
· 我和我的祖國
· love
· Amazed / Hold On
· angel of the morning / drive m
· 溫哥華
· 兒歌:中國不投降
· 有個能人叫馬雲
· 一個溫哥華朋友對郭文貴的政治解
· 利用唱歌反黨,是一大發明
【感想】
· 加沙委員會看來是在幫以色列打理
· 中國應該如何看待加沙和平委員會
· “斬殺線” 為何讓美國主流媒體急
· 斬殺線
· 重溫列寧的帝國主義論
· 一箭四雕---1 打擊中國 2 石油利
· 新自由主義---資本主義的最後狂
· 別再羨慕美國中產!一條斬殺線
· 斬殺線現象深度解析/中國賺錢美
· 吃瓜蒙主,借古諷今
存檔目錄
2026-01-01 - 2026-01-23
2025-12-03 - 2025-12-29
2025-11-23 - 2025-11-23
2025-10-01 - 2025-10-28
2025-09-02 - 2025-09-28
2025-08-05 - 2025-08-29
2025-06-01 - 2025-06-22
2025-05-03 - 2025-05-30
2025-04-01 - 2025-04-30
2025-03-07 - 2025-03-31
2025-02-03 - 2025-02-27
2025-01-03 - 2025-01-29
2024-12-01 - 2024-12-31
2024-11-01 - 2024-11-30
2024-10-01 - 2024-10-30
2024-09-04 - 2024-09-29
2024-08-02 - 2024-08-31
2024-07-03 - 2024-07-25
2024-06-01 - 2024-06-30
2024-05-03 - 2024-05-31
2024-04-05 - 2024-04-27
2024-03-01 - 2024-03-30
2024-02-01 - 2024-02-28
2024-01-03 - 2024-01-31
2023-12-01 - 2023-12-31
2023-11-01 - 2023-11-28
2023-10-01 - 2023-10-31
2023-09-06 - 2023-09-29
2023-08-03 - 2023-08-31
2023-07-01 - 2023-07-30
2023-06-07 - 2023-06-30
2023-05-02 - 2023-05-31
2023-04-02 - 2023-04-30
2023-03-02 - 2023-03-31
2023-02-01 - 2023-02-27
2023-01-04 - 2023-01-31
2022-12-03 - 2022-12-31
2022-11-06 - 2022-11-30
2022-10-01 - 2022-10-30
2022-09-02 - 2022-09-29
2022-08-01 - 2022-08-31
2022-07-02 - 2022-07-29
2022-06-02 - 2022-06-29
2022-05-01 - 2022-05-29
2022-04-01 - 2022-04-30
2022-03-01 - 2022-03-31
2022-02-03 - 2022-02-28
2022-01-01 - 2022-01-29
2021-12-01 - 2021-12-31
2021-11-04 - 2021-11-30
2021-10-02 - 2021-10-20
2021-09-02 - 2021-09-28
2021-08-01 - 2021-08-31
2021-07-01 - 2021-07-30
2021-06-01 - 2021-06-30
2021-05-01 - 2021-05-30
2021-04-03 - 2021-04-30
2021-03-02 - 2021-03-27
2021-02-01 - 2021-02-24
2021-01-01 - 2021-01-29
2020-12-03 - 2020-12-31
2020-11-02 - 2020-11-29
2020-10-03 - 2020-10-31
2020-09-01 - 2020-09-29
2020-08-01 - 2020-08-27
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-03 - 2020-03-31
2020-02-01 - 2020-02-29
2020-01-01 - 2020-01-29
2019-12-01 - 2019-12-31
2019-11-01 - 2019-11-28
2019-10-01 - 2019-10-31
2019-09-01 - 2019-09-30
2019-08-04 - 2019-08-31
2019-07-07 - 2019-07-31
2019-06-01 - 2019-06-29
2019-05-01 - 2019-05-30
2019-04-01 - 2019-04-29
2019-03-01 - 2019-03-30
2019-02-01 - 2019-02-25
2019-01-03 - 2019-01-31
2018-12-01 - 2018-12-30
2018-11-02 - 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-02 - 2018-04-30
2018-03-01 - 2018-03-30
2018-02-01 - 2018-02-28
2018-01-02 - 2018-01-29
2017-12-01 - 2017-12-30
2017-11-02 - 2017-11-29
2017-10-02 - 2017-10-29
2017-09-01 - 2017-09-30
2017-08-03 - 2017-08-26
2017-07-03 - 2017-07-31
2017-06-01 - 2017-06-29
2017-05-01 - 2017-05-31
2017-04-01 - 2017-04-30
2017-03-01 - 2017-03-28
2017-02-02 - 2017-02-28
2017-01-03 - 2017-01-31
2016-12-31 - 2016-12-31
2016-11-01 - 2016-11-28
2016-10-09 - 2016-10-29
2016-09-01 - 2016-09-18
2016-08-01 - 2016-08-31
2016-07-01 - 2016-07-31
2016-06-01 - 2016-06-29
2016-05-01 - 2016-05-31
2016-04-01 - 2016-04-30
2016-03-01 - 2016-03-31
2016-02-03 - 2016-02-28
2016-01-02 - 2016-01-31
2015-12-01 - 2015-12-30
2015-11-01 - 2015-11-28
2015-10-01 - 2015-10-30
2015-09-01 - 2015-09-29
2015-08-05 - 2015-08-31
2015-07-01 - 2015-07-30
2015-06-03 - 2015-06-30
2015-05-03 - 2015-05-31
2015-04-04 - 2015-04-21
2015-03-05 - 2015-03-30
2015-02-07 - 2015-02-26
2015-01-01 - 2015-01-17
2014-12-07 - 2014-12-27
2014-10-03 - 2014-10-18
2014-09-01 - 2014-09-25
2014-08-12 - 2014-08-27
2014-07-05 - 2014-07-20
2014-06-01 - 2014-06-06
2014-05-19 - 2014-05-19
2014-04-19 - 2014-04-27
2014-03-27 - 2014-03-27
2014-01-04 - 2014-01-04
2013-12-01 - 2013-12-28
2013-11-10 - 2013-11-23
2013-10-14 - 2013-10-29
2013-09-21 - 2013-09-21
2013-08-16 - 2013-08-27
2013-07-04 - 2013-07-27
2013-06-23 - 2013-06-23
2013-05-02 - 2013-05-24
2013-04-04 - 2013-04-29
2013-03-02 - 2013-03-29
2013-02-25 - 2013-02-28
2013-01-07 - 2013-01-28
2012-12-02 - 2012-12-31
2012-11-07 - 2012-11-15
2012-10-01 - 2012-10-29
2012-09-15 - 2012-09-15
2012-08-02 - 2012-08-27
2012-07-16 - 2012-07-29
2012-06-20 - 2012-06-20
2012-05-01 - 2012-05-12
2012-04-06 - 2012-04-16
2012-03-05 - 2012-03-25
2012-02-09 - 2012-02-25
2012-01-14 - 2012-01-24
2011-12-14 - 2011-12-28
2011-11-11 - 2011-11-26
2011-10-15 - 2011-10-29
2011-09-02 - 2011-09-12
2011-08-02 - 2011-08-25
2011-07-01 - 2011-07-23
2011-06-19 - 2011-06-26
2011-05-23 - 2011-05-23
 
關於本站 | 廣告服務 | 聯繫我們 | 招聘信息 | 網站導航 | 隱私保護
Copyright (C) 1998-2026. Creaders.NET. All Rights Reserved.