Home >Web Front-end >HTML Tutorial >What is Pseudo-Static state

What is Pseudo-Static state

php中世界最好的语言
php中世界最好的语言Original
2017-11-22 14:49:365418browse

Today I would like to introduce to you what pseudo-static is and the role of pseudo-static. Pseudo-static is relative to real static. Usually, in order to enhance the friendliness of search, we generate static pages from article content, but some friends want to display some information in real time. Or you also want to use dynamic scripts to solve some problems. Website content cannot be displayed in a static manner. But this loses the friendliness of the search index. How to find a middle method between the two, which gave rise to pseudo-static technology. What is displayed is a static page such as HTML, but it is actually processed using dynamic scripts such as ASP.

Pseudo-static means that the website itself is a dynamic web page such as .php, .asp, .aspx and other formats. Sometimes such dynamic web pages also add parameters with "?" to read different data in the database. A very typical case is the discuz forum system. There is a pseudo-static function in the background. After pseudo-static is turned on, the dynamic web page is converted and rewritten into a static web page type page. The address accessed through the browser is no different from the real static page. The prerequisite is that the server supports the pseudo-static URL Rewrite function.

Where pseudo-static functions are needed

Consider search engine optimization (SEO) and process dynamic web pages into static pages through the server, such as www.xxx.com/jk/fd.php?=12 Dynamic web pages are processed into static pages in the format www.xxx.com/jk-fd-12.html. Common forum post pages are pseudo-statically processed into static page format html pages.

Considering that the programming language used by the website is not easy to be discovered, the program suffix of the dynamic web page is changed to the static page format of html by rewriting it to pseudo-static.

The pros and cons of pseudo-static

Of course, as the author of an article said: "If the traffic is slightly larger and pseudo-static is used, the CPU usage will be overloaded. I have 300 online at the same time. It hangs for many people, but when more than 500 people are online at the same time without using pseudo-static, it does not hang. My IIS number is 1000. "

This is indeed the case, because pseudo-static uses regular expressions instead of judgment. As for the real address, the responsibility for determining which page to display is transferred from direct specification to the CPU. Therefore, the increase in CPU usage is indeed the biggest drawback of pseudo-static.

Should we choose pseudo-static or true static?

1. There is no difference between using true static and false static 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 heavy use 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 eliminated, because no matter how it is generated, it will be very harmful to the hard disk.

2. Since the effect of true and false static is the same, we can choose pseudo static.

3. However, extensive use of pseudo-static will cause CPU overload.

4. So as long as we don’t use it in large quantities, it’s fine.

5. Since static is only for SEO, we only need pseudo-static for SEO, and there is no need for users to use it.

6. So we only need to use pseudo-static in the Archiver specially provided for SEO crawling.

7. Thank you all for your patience in reading my article.

8. If you have any questions or different opinions, please feel free to ask.

Comments on pseudo-static and true static

There is an essential difference between true static and pseudo-static. Processing a pure HTML for browsing users and a PHP that calls multiple data have significantly less CPU usage than the former. I remember someone once said that html downloads are frequently read and written to the hard disk. He said this as if reading the database does not require reading and writing to the disk. What's more, there are a lot of cached scattered PHP files that are also placed on the hard disk. Doesn't these reads require disk operations? ridiculous.

Reading a single htm+pictureFlash and other attachments can achieve the purpose, why bother reading the database, reading the php cache file, reintegrating the data output, and then +pictures Flash and other attachments are so big Where is Fei Zhouzhang? The CMS home page does not require a lot of interaction, and the forum version should not be used here. On the contrary, what should be considered more is: beauty! compatible! Intuitive information! performance! And stability!

Through our introduction, we believe that everyone has already understood pseudo-static. Friends in need can save it. Please also continue to pay attention to other updates on this site.

Related reading:

How to clear floats in CSS


How to use the label tag in html


How to modify the HTML title tag element

The above is the detailed content of What is Pseudo-Static state. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn