5/7/2023 0 Comments Fminer generate urlsSo where does ASP.NET MVC fit into this? Well, ASP.NET, as you probably know, typically runs on Microsoft's web server, called IIS. It has become second nature to many (maybe most?) web veterans to always include the slash at the end of URLs that do not point to a file. Doing so completely eliminates the wasted processing time and bandwidth usage. For this reason, the prevailing rule of thumb has been to put the trailing slash on all URLs that point to a directory. Without explicitly specifying a resource, the requester creates an overhead in both processing time and bandwidth usage. The server looks for the ambiguous directory and returns the appropriate response.It sends a response back to the client, redirecting it to.The server looks for a file called ambiguous.When receiving a request for this resource, a traditional web server goes through the following process: It could be a file, but there is no extension it could be a directory, but there's no trailing slash. For example, the URL points to a resource called ambiguous, but it is unclear what that resource is. These two examples demonstrate a simple process, but it can get more complex with ambiguous requests. When the web server receives this request, it looks for the directory directory, and if it finds it, it gets the default document and returns it to the client. This URL ends with a trailing slash, denoting a directory. Traditional web servers do the same thing for directory requests.Ĭonsider the URL of. If it finds the file, it serves its contents if not, it responds with an error. When the web server for receives a request for that URL, it knows exactly where to look for the resource. The URL of points to a physical file (the resource) called file.html that resides in a directory called directory on a web server found at the domain. URL stands for Uniform Resource Locator it tells web-aware clients where to locate a particular resource on the Internet. It may seem like a non-issue (and to many people it's not one), but many developers, this author included, are bugged by them. The ASP.NET MVC framework bucks tradition and convention, and the built-in methods that generate URLs do so by omitting the trailing slash. There are certain truths in the world: we're born, we die, and URLs should end with a slash if it doesn't point to a file.
0 Comments
Leave a Reply. |