How to deal with the influence of web Hollow path on Page performance
This article is about how to deal with the impact of web hollow paths on page performance. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I saw the sharing of Yubo blog on Google Reader a few days ago-the impact of empty paths on page performance. Indeed, when writing CSS, using background:url (#) will make one more request to the page.
However, because writing multiple CSS, generally need to use an empty background to solve the bug, the test results with background:url (about:blank) is what we want: solve the bug, does not affect performance. That's very simple. Won't the solution come out? Wait, let's do a test.
Test the code:
The code is as follows:
Empty src
Body {font-family:courier, 'courier new';} code {background:#f7f7f7;border:1px solid # ddd;padding:0 3px Toun Muzmakit cite cite 2pxTen 2pxFont Mustang 2pxFont Mustang 12pxColorusWan080;} p {color}
1. Send a request:
Browsers: All, some browsers such as chrome, hash (#) and null only request this path
The background image uses background:url (#) to send the request
(2) partially send the request:
Browsers (very small latency): safari, chrome (multiple about:blank will send multiple requests)
Use about:blank
Hello world
Second, do not send a request:
Browser: all, chrome (invalid delay, equivalent to no request sent)
Use _ javascript:''
Don't bother to take screenshots, do it by yourself. The browsing results have been roughly written on the test page. The ultimate solution is:
Boldly use about:blank instead of null, or'#', especially in background-image
It is recommended to use _ javascript: "to solve the problem in img / script / iframe
Thank you for reading! This is the end of the article on "how to deal with the impact of web hollow path on page performance". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!