ASP.NET pseudo-static implementation and pseudo-static significance
I. Use of pseudo-static
Some users feel that pseudo-static and true static will be included in the actual amount of difference, in fact, from your personal point of view, you to judge whether a post is true static or pseudo-static? It is probably difficult to see, because the so-called static means that there is no question mark in the address. If there is no question mark in the address, it is static, whether it is real or fake? Can search engines see it? Therefore, whether it is real or fake, it is actually the same for search engines. The search engine did not say that this is fake and I will not include you.
To the bottom line, why do search engines not include URLs with question marks? Because search engines are afraid of entering an infinite loop due to question marks, they are called search robot traps (there was such a loophole in the mobile network before, and spiders could not get out), so many times, address search engines with question marks will not enter. Pseudo-static is actually static for search engines. Because there is no question mark in the address, there is no saying that true static is more included than pseudo-static.
2. Why choose pseudo-static?
Many users say: Is it bad to be static? Why not use being really static? Isn't it faster to visit? Isn't the load better? Wait, wait, wait,
Here, there is actually only one question to answer: Why choose MYSQL? Many users probably don't understand why so many large forums choose MYSQL database as the storage mechanism. Most of them probably think: Because DZ uses MYSQL, it's MYSQL.
In fact, this is not the case. Imagine why DZ survived and laughed proudly in the days when so many forum programs coexisted. The big reason is that DZ used MYSQL. Imagine if the program changed by Big C back then was a text forum, would DZ still be what it is today? Or from another perspective, why do so many large websites choose MYSQL instead of text as their storage mechanism?
The so-called text forum is actually similar to the true static statement. It stores data in space, reads and writes a lot of hard disk, etc. hellip; hellip;
Why was this writing eliminated? I believe the answer will not be what the teacher said:"discuz! There are currently 2129867 posts, which are about 20799M if stored in html, which is about 20 GB. Not to mention the waste of space caused by disk storage mechanism (100 1k files may occupy 200K of space). quot;
From my personal point of view, this reason does not give users a good reason not to use true static. However, another reason is worth considering, and why most stations do not choose to generate static:
"Deleting and updating this html content will result in a lot of disk io operations and a lot of disk fragmentation.& quot;
As stated above, in practice, it does lead to a large number of disk I/O operations (input/output), and the consequences of a large number of I/O operations can be imagined, resulting in a large number of disk fragments and even bad sectors on the hard disk.
So for static generation, it's better to use text forums to better solve your needs. (Deputy W was born as a text forum. At that time, its name was ofstar, but it was changed to MYSQL due to development difficulties. PW generated static pages, which were slightly improved in PW's previous text method to attract users 'attention)
Of course, if you have a good memory, you should be able to remember that the PW forum could not be accessed for a long time during PW4, and later the data from a period of time was restored. The official statement is that the hard disk was damaged due to an attack. In fact, this statement is relatively unreliable. Compared with the result of being attacked leading to hard disk damage or the result of a large number of I/O operations, I personally prefer the latter.
Of course, if you are more concerned about 5d6d, you should know that 5d6d was inaccessible one day in the past few days. According to unofficial news, it was because the hard disk was broken, and the reason for the damage was naturally because a large number of users were performing a large number of I/O operations. Imagine, in our forum, disk I/O operations are only performed by administrators when updating and caching, and every member of 5d6d is an administrator. Imagine how much test it is for the disk? So I'm not surprised that the 5D6D hard drive is broken.
Of course, perhaps many of the friends reading this article have used BT, and have heard that BT is very harmful to hard drives and cannot be driven too much. The so-called damage refers to the same thing here. A large amount of I/O causes disk fragmentation or even bad disk sectors.
Here are some very practical examples to illustrate the problem.
3. The disadvantages of pseudo-static
Of course, as the author of an article said: If the traffic is slightly larger and using pseudo-static, the CPU will be overloaded. If more than 300 people are online at the same time, I will die. If I don't use pseudo-static, more than 500 people are online at the same time. No, my ISS number is 1000." quot;
This is indeed the case. Since pseudo-static uses regular judgments rather than real addresses, the responsibility of distinguishing which page to display also shifts from direct designation to the CPU. Therefore, the increase in CPU occupancy is indeed the biggest shortcoming of pseudo-static.
4. Should we choose pseudo-static or true static?
Let's sum up:
1. Using real static and fake static is no different for SEO
2. Using true static may cause hard disk damage and affect forum performance
3. Using pseudo-static will occupy a certain amount of CPU occupancy, and using it in large quantities will cause CPU overload.
4. The most important point is that we want static for SEO
So:
1. Using the true static method can be directly ruled out, because no matter how it is generated, it will be very harmful to the hard disk.
2. Since the effect of authenticity and authenticity is the same, we can choose pseudo-static.
3. However, heavy use of pseudo-static will cause CPU overload.
4. So we just need not use it in large quantities.
5. Since static is only for SEO, we only need pseudo-static for SEO, not for users to use.
6. So we just need to use pseudo-static in the Archiver specially provided for SEO crawlers.
7. Thank you for your patience in reading the article I wrote.
8. If you have any doubts or different opinions, please ask.
5. Comments on pseudo-static and true static
There is still an essential difference between true statics and pseudo-statics. Processing a pure htm for browsing users and a php that calls multiple data have significantly less CPU usage. I remember someone said that html downloads are frequently read and written to the hard disk. He said this as if you don't need to read and write to the disk to read the database. Not to mention that there are a lot of cached scattered php that are also placed on the hard disk. Do you need to read these without disk operations? Ridiculous.
The purpose can be achieved by reading a single htm+ picture Flash and other attachments. Why bother reading the database and reading the php cache file and reintegrating the data output and + picture Flash and other attachments? The CMS home page does not require a lot of interaction. The forum system should not be used here. On the contrary, more consideration should be given to: aesthetics! Compatible! Intuitive information! Performance! And stability!
In fact, the so-called pseudo-static page refers to URL rewriting, which is very simple to implement in ASP.NET.
First you need to reference two DLLs in your project:
ActionlessForm.dll
URLRewriter.dll
The real rewrite is URLRewriter.dll, but if you want to implement paging, you must use this ActionlessForm.dll
First write in web.config
~/Products/Jurisdiction_(w{3})。aspx
~/En/Jurisdiction.aspx? jurid=$1
~/Articles/(d{1,})。aspx
~/Articles/(d{1,})_(d{1,})。aspx
This way, for example, the above website http://localhost/En/Article_View.aspx? Article_id=9 can be replaced with http://localhost/Articles/9.aspx. Of course, the extension you replace can use any extension that iis can interpret. If you like to use htm as an extension, then configure the forwarding rules to have htm as an extension. Some articles may also be very long, and we often divide an article into several pages. So based on the above configuration, if we want to access http://localhost/En/Article_View.aspx? Article_id= 9page =3 We can replace it with http://localhost/Articles/9_3.aspx, so that when the search engine comes to grab your web page, it will include your URLs and others can search for your web page, you can link from these addresses.
Then operate like this:
Right-click on my computer--Manage--Expand services and applications--Internet information services--Find the directory you share--Right-click on properties--Click Configure-->
Map below-find. Aspx's executable file path Copy path--paste path--extension.html--and remove the check box to check whether the file exists. That's enough