Today suddenly curious, want to distinguish between WWW.ABC.COM/EFG and www.abc.com/efg/the two URLs of the difference. That is to analyze the URL at the end of the addition of a slash whether there is a special effect.
Find the online Introduction:
When the Web server receives a URL request that does not contain a slash at the end, such as "WWW.ABC.COM/EFG", the server searches for a file that has the name "abc" in the root directory of the Web site, and if it does not, it is treated as a directory and returns to the default home page in the ABC directory. When the Web server receives a request with a slash at the end, it is treated directly as a directory.
Similarly, according to Microsoft Official documents Internet Explorer and Connection Limits:
Another web-performance Tip:when generating hyperlinks, always include a trailing slash if possible. For instance, navigating to http://msdn.microsoft.com/ie takes one more roundtrip than http://msdn.microsoft.com/ie/. When the browser navigates-the/ie URL, the server merely sends down a 301 to The/ie/url. Both links work, and the second version is faster.
OK, according to the above material, whether we can think URL plus slash can speed up access.
Next, test it with a simple flask project:
The Flask framework binds HTTP://127.0.0.1:5000/ABC and http://127.0.0.1:5000/def/URLs by routing binding URLs and view functions.
Summarize:
- Web sites to be unified standards, either user access and site URL routing at the end of the URL without a slash, or not at the end of the URL slash, if the use of uniform standards at the speed of access will not be any difference.
- However, the user's behavior is not limited and predictable. The user may add a slash after the URL.
- Two technical solutions each have pros and cons: 1. The website route URL does not have the slash, the user adds the slash post to access 404, but does not have the redirection problem; 2. Site routing URL plus slash, user access to the URL regardless of the slash can be access to normal, but no slash access links do redirect, affect access speed.
<wiz_tmp_tag id= "Wiz-table-range-border" contenteditable= "false" style= "Display:none;" >
A slash action quest at the end of a URL