Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The meaning of each indicator of yslow

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

User fewer HTTP Requests: Reduce HTTP requests

Images, CSS, JS, flash, etc. all need to increase the number of http requests, and reducing the number of these elements can reduce response time.

Combine multiple JS and CSS as much as possible (except JS library, which is more reliable with cache on other websites)

Small images are put together as much as possible, using CSS background positioning.

Use a Content Delivery Network Leveraging CDN technology

This can effectively reduce the pressure between the web layer and the server, and works better with cache and lvs

Avoid empty src or href Empty path that does not exist

similar to

Don't link like that.

Add an Expires headers Set Cache Control

Add a paragraph to the.htaccess file

ExpiresActive On

ExpiresDefault “access plus 7 days”

ExpiresByType p_w_picpath/x-icon “access plus 30 days”

ExpiresByType p_w_picpath/gif “access plus 30 days”

The server cannot be used without mod_expires support.

Compress components with gzip Settings GZIP Compress

In the cPanel website optimization, select the second item, all compressed.

PS:

Note here that not everything is gzip, if the data is less than 1500 bytes, in theory you can not gzip, because small things themselves will not cost traffic, if you gzip may increase the cost of decompression.

Small Js should merge.

Put CSS at top CSS para la head

This is how normal websites work, right?

Put JavaScript at bottom JS put feet

If your web page doesn't rely heavily on JS, it's better to keep JS at your feet.

Avoid CSS Expressions Avoid CSS Expressions

Every CSS textbook will tell you not to write Expressions, not to explain

Make Javascript and CSS external Use external Javascript and CSS files

Of course you do.

Reduce DNS Lookups Reduce DNS lookups

Reduce website resource calls from external websites.

Minify Javascript and CSS

JS and CSS are minimized, and many tools can be used to compress them.

Avoid URL redirects Avoid redirects

In addition to avoiding 3XX type redirects, there is a small problem, it is best not to write a URL like aa.com/bb, because it will be redirected to aa.com/bb/, although Apache can use mod_rewrite, but it is best not to write this.

Remove duplicate javascript and CSS Remove duplicate scripts and CSS

The most common is to load jquery multiple times, and it is clear at a glance when viewing it with jsview.

Configure ETags Configure ETags

Want to know what ETags are Google?

The solution is to add FileETag None to.htaccess.

Make AJAX cacheable Set up cache for AJAX

AJAX message fetching is asynchronous, which means that users do not necessarily wait for asynchronous responses. To avoid repeated AJAX requests, caching is a good way to optimize performance.

Use GET for AJX requests

AJAX with Get do not use Post, this AJAX book will be introduced inside.

Reduce the number of DOM elements Reduce the number of DOM elements

This requires xhtml to have a good framework.

Avoid HTTP 404 (Not Found) error

404 is bad for both the server and the user.

Reduce cookie size Reduce cookie size

Cookies are controlled within 4K.

Use cookie-free domains Use cookie-free domains

Here is the static server problem, mainly refers to some static files such as images, CSS, etc., if there is no secondary domain name, then in the request for these domain names will be sent under the cookie, but the Server will not pay attention to him, so it will waste bandwidth and time.

If you set up a pan-domain name, you can only re-apply for a domain name to do static.

For example, YAHOO, whose static files are all on yimg.com, reduces the impact of repeated transmission of cookies on the main domain name when the client requests static files.

Avoid AlphaImageLoader filter

Avoid using the AlphaImageLoader filter.

Do not scale p_w_picpaths in HTML Don't scale images

W3C has not advocated image scaling, on the one hand, is a waste of server resources, on the other hand, is also a waste of performance.

Make favicon small and cacheable Make icons as small as possible and use caching.

This refers to favicon.ico, the favicon.ico cache has been set up before.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report