In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Xiaobian to share with you how to use to improve the speed of website access, I believe most people do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let us go to understand it together!
Recently, the company began to assess all the sites under the enterprise station, starting with itpub. To that end, start learning about how to optimize a website for faster access. Page speed is a great tool to download. Page Speed is an open source Firefox/Firebug add-on. Webmasters and web developers can use Page Speed to evaluate the performance of their web pages and get suggestions on how to improve performance. Perform several tests on the web server configuration and front-end code of the website. These tests are based on a set of best practices known to enhance web page performance. Webmasters who run Page Speed on a web page receive a set of scores for each page, as well as useful suggestions on how to improve the performance of the page. It will make your website faster and reduce bandwidth costs.
1 First you have to install this plug-in, how to press, skip;
2 After installation, press F12 to show the following figure
3 Click on the above picture to appear wreath below:
This 82/100 is your station according to the page speed assessment score
It's good to decide for yourself.
Yellow indicates warnings that can be further optimized
Green means it's good.
The red ones are bad and need to be optimized.
(ITPUB doesn't have red, which is good.)
4 See "Enable keep-alive" I'll highlight keep-alive in another post. to be continued
Description: keep-alive needs to be enabled for it168.com, but this is a host of another project group, and I have no right to modify it. Therefore, in this case, in the future, hosts that are not under their jurisdiction will be directly passed.
5 Comments on compressed javascript below
Pagespeed's advice to you is to compress the following 2 js. You click on the back of the op... It will generate a compressed js for you. Then you can replace the original js. This place only shows how to do it. Of course, jquery also has a min version of js compressed.
6 on CDN
In fact, there is a more important aspect to doing this. If your company has no money, you can do it according to the above. If the company has money, it can add dynamic CDN.
Tomorrow or the day after tomorrow, start giving ITPUB a dynamic CDN, while separating out image attachments with separate domain names. The current home page first screen time is 3.156s
I hope that after finishing the CDN, the network speed will be greatly improved!!!
===============================================================================================
Here are some ideas about performance optimization skills, which are also the "military rules" circulated on the Internet:
1 Enable gzip.
gzip compression is a compression algorithm developed and supported by mainstream browsers (Firefox, Safari, Chrome, IE4 and above) and mainstream servers (Apache, Lighttpd, Nginx). gzip compression is described by Content-Encoding : gzip in HTTP 1.1 protocol, which can significantly reduce the size of text files, thus saving bandwidth and load time. In an experiment I did, I found that with gzip enabled, the size of jquery 1.2.6 minify was reduced from 54.4k to 16k, a 70% reduction. Gzip applies to:
HTML\CSS\JavaScript files, gzip algorithm for text files is more efficient, and jpg/gif/png/pdf binary files themselves have been compressed once, and then the effect of using gzip is not obvious. And gzip compression needs to consume server resources, while decompression needs to consume browser resources, which has very high performance consumption for relatively large binary files;
Try to use one case, either all caps or all lowercase. Students who have studied data structure and algorithm must know that compression itself is to compress redundant information entropy, and how to reduce the redundancy of information due to too many types of data elements, thus reducing the compression rate;
Too small files (usually less than 150 bytes) should not be compressed by gzip, because gzip will add relevant information to the file header, and for small files, it will increase the length of the file;
(The above text is taken from www.yakecan.com/archives/3 and I agree with it)
How do you know if your server is open?
Take a server on my side as an example. My web server is nginx. Let's say nginx:
Open the nginx configuration file, you will see the relevant gzip settings, if not, please enable your company's O & M colleagues.
Types is the type of file used to gzip.
You can use webmaster tools to see if your site uses gzip, such as http://tool.chinaz.com/Gzips/to view
Take one of my sites for example,
You can see this result.
2 Minimize JS and images
You can use a compression tool to compress it. There is a lot of room for optimization for JavaScript files themselves. JavaScript compression is to optimize functions and variable names through some tools (in fact, shorten the length of variable names as much as possible), eliminate redundant characters (such as spaces, newlines, comments, etc.), and finally get code that can be analyzed and executed. The compressed code is readable by machines, but not by humans, because the contents of the file are beyond recognition. Therefore, compression code that is normally used in production cannot be used in development.
3 JavaScript Minimization
For example, jquery.form.js reduces 11.9kb after minimization, reducing space by 54.8%. Click minified version, you can see the optimized version of Page Speed for you in the new window, update it directly to the server.
4 Enable browser caching
This is a method often used. Once the requested resource is cached locally in the browser, a second request for that content can be retrieved from the direct cache, reducing the number of HTTP requests over the wire.
5 JavaScript delayed loading
Usually, when the browser encounters JS files when parsing HTML, it will download them first, and the latter content will be downloaded only after the parsing is executed, which will naturally cause a certain delay. To improve performance, move JS files back as much as possible and, if possible, load asynchronously through portions of code. In addition, for JS and CSS must be placed together, JS needs to be placed after CSS, so that CSS and JS files can be downloaded synchronously.
6 file splicing, that is, files that can be merged, merged into one file
7 Reduce HTTP requests. This is used in conjunction with the above.
8 Load only part of js in head. The rest can be loaded at the bottom.
The above is "how to improve the speed of website access" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.