Home Backend Development PHP Tutorial Recommended video tutorial materials for php to achieve page staticization

Recommended video tutorial materials for php to achieve page staticization

Aug 30, 2017 pm 03:01 PM
php Tutorial video

As we all know, page staticization is an essential skill in the development of portal websites. "Video Tutorial on Implementing Page Staticization in PHP" analyzes it from two perspectives: pure staticization and pseudo-staticization, and leads everyone to master how to achieve page staticization in PHP. Generate purely static pages and how to configure pseudo-static in the WEB server to help everyone master another salary increase tool.

Recommended video tutorial materials for php to achieve page staticization

Course playback address: http://www.php.cn/course/403.html

The teacher’s teaching style:

The teacher’s lectures are vivid, witty, witty, and touching. A vivid metaphor is like the finishing touch, opening the door to wisdom for students; an appropriate humor brings a knowing smile to students, like drinking a glass of mellow wine, giving people aftertaste and nostalgia; a philosopher's aphorisms, cultural references Proverbs are interspersed from time to time in the narration, giving people thinking and warning.

The more difficult point in this video is PHP's processing of pseudo-static:

First of all, what is pseudo-static:

Pseudo-static, also known as URL rewriting, is a dynamic URL that looks like a static URL. In other words, dynamic web pages remove the parameters of dynamic web pages by rewriting the URL method, but there is no need to implement rewritten pages in the actual web page directory.

In addition, two noun parsing are being added

Static URL: Pure static HTML document, web page that can be queried using filetype:htm

Dynamic URL: The content is stored in the database , display the content according to the requirements, the URL starts with? # & Display different parameters, such as: news.php? lang=cn&class=1&id=2

The pros and cons between dynamic, static and pseudo-static (new)

Dynamic URL

First of all, dynamic URL is currently not suitable for Google The statement "cannot be crawled" is wrong. Google can handle dynamic URLs very well and crawl them smoothly. Secondly, the statement "cannot have more than 3 parameters" is also incorrect. Google can crawl dynamic URLs with more than 3 parameters. Dynamic URLs, however, should minimize parameters in order to avoid the URL being too long.

Secondly, dynamic URLs have certain advantages. As mentioned above, news.php? lang=cn&class=1&id=2 For example, the parameters in the URL accurately tell Google that the content language of this URL is cn, it belongs to category 1, and the content ID is 2, which makes it easier for Google to identify and process the content.

Finally, dynamic URLs should be as concise as possible, especially the session identifier (sid) and query (query) parameters, which can easily lead to a large number of identical pages.

Static URL

First of all, the absolute advantage of static URL is its clarity. /product/nokia/n95.html and /about.html can be easily understood and thus appear in the search results. Maybe the number of clicks is relatively high.

Secondly, static URLs may not be the best URL form. As mentioned above, dynamic URLs can tell Google some identifiable parameters, while static URLs will not be properly arranged if the document layout is not appropriate (such as too flat). , placing all HTML documents in the root directory) and other factors, it is not as rich in reference information as static URLs provide Google.

Finally, does Le Sishu think there is any hidden meaning in Google’s article? "Updating pages with this type of URL can be time-consuming, especially when the amount of information grows quickly, because the compilation code must be changed for each individual page." Although it is a website, is it the same in the Google system? Does such a problem exist?

Pseudo-static URL

First of all, pseudo-static URLs cannot make dynamic URLs "static". Pseudo-static URLs are just a rewrite of dynamic URLs. Google will not consider pseudo-static URLs to be HTML documents. .

Secondly, pseudo-static is desirable, but the focus should be on removing redundant parameters, standardizing URLs, and avoiding duplicate pages as much as possible.

Finally, pseudo-static has great potential dangers. It is best to use it when you are familiar with the website system, website structure, content distribution, and parameter meaning.

When writing pseudo-static rules, you should retain valuable parameters and do not streamline all valuable parameters, such as news.php in the previous example? lang=cn&class=1&id=2 is better rewritten as news-cn-class1-id2.html rather than overly concise and rewritten as news-2.html.

Furthermore, the pseudo-static must not contain session ID (sid) and query (query) parameters, /product.asp? For a dynamic URL like sid=98971298178906&id=1234, the sid in it is originally recognized and blocked by Google. However, if it is rewritten as /product/98971298178906/1234, Google will not only be unable to recognize it, but will also cause unlimited duplicate pages in the entire site (each session A new session ID will be generated).

Should we choose pseudo-static or true static

1. There is no difference between using true static and false static for SEO

2. Use 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 thing One thing, we need to be 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 effects of true and false static are 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, you are welcome to comment

on pseudo-static and true static.

There are still true static and pseudo-static Essential difference. 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 the hard disk is frequently read and written when downloading HTML. 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 that are also placed on the hard disk. Doesn't these reads require disk operations? ridiculous.

The purpose can be achieved by reading a single html + image Flash and other attachments. Why bother reading the database, reading the PHP cache file, re-integrating the data output, and then adding image Flash and other attachments? The CMS homepage 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!

The above is the detailed content of Recommended video tutorial materials for php to achieve page staticization. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles