Introduction to the use of HTTP equiv attribute in meta tag

Time:2021-3-1

Meta is an auxiliary tag in the head area of HTML language. Maybe you think it’s optional. In fact, if you can make good use of meta tags, it will bring you unexpected effects. The functions of meta tags include: search engine optimization (SEO), defining the language of the page, automatically refreshing and pointing to new pages, realizing the dynamic effect of web page conversion, controlling page buffer, web page rating and evaluation, controlling the window of web page display, etc!

Composition of meta tags: meta tag has two attributes, they are HTTP equiv attribute and name attribute, different attributes have different parameter values, these different parameter values realize different web page functions.

1. Name property

The name attribute is mainly used to describe Web pages, and the corresponding attribute value is content. The content in content is mainly used for search engine robots to find information and classify information.

The syntax format of the name attribute of the meta tag is:

< metaname = “parameter” content = “specific parameter value” >.

The name attribute has the following parameters:

A. Keywords (keywords)

Description: keywords is used to tell the search engine what the keyword of your web page is.

For example: < metaname = “Keywords” content = “science, education, culture, politics, ecnomics, relationships, entertainment, human” >

B. Description (website content description)

Description is used to tell the search engine the main content of your website.

For example: < metaname = “description” content = “this page is about the meaning of science, education, culture. >”

C. Robots (robot Guide)

Description: robots is used to tell search robots which pages need to be indexed and which pages don’t need to be indexed.

The parameters of content are all, none, index, Noindex, follow, nofollow. The default is all.

For example: < metaname = “robots” content = “None” >

D. Author

Description: annotates the author of the page

For example: < metaname = “author” content=“ root,[email protected] “>

2. HTTP equiv property

As the name suggests, HTTP equiv is equivalent to the file header of HTTP. It can send back some useful information to the browser to help display the content of the web page correctly and accurately. The corresponding attribute value is content, and the content in content is actually the variable value of each parameter.

The syntax format of HTTP equiv attribute of meta tag is as follows:

< metahttp equiv = “parameter” content = “parameter variable value” >;

The HTTP equiv attribute has the following parameters:

A. Expires (term)

Note: it can be used to set the expiration time of the web page. Once the page is out of date, it must be retransmitted to the server.

Usage: < metahttp equiv = “expires” content = “Fri, 12jan, 200118:18:18gmt” >

Note: the time format of GMT must be used.

B. Pragma (cache mode)

Note: the browser is forbidden to access the page content from the local computer’s cache.

Usage: < metahttp equiv = “pragma” content = “no cache” >

Note: with this setting, visitors will not be able to browse offline.

C. Refresh (refresh)

Description: automatically refresh and point to the new page.

Usage: < metahttp equiv = “Refresh” content = “2; URL= https://www.jb51.net “> (note the quotation marks at the end, which are in front of the seconds and behind the URL respectively)

Note: 2 refers to automatically refresh to the URL after 2 seconds.

D. Set cookie (cookie setting)

Note: if the page is out of date, the saved cookie will be deleted.

Usage: < metahttp equiv = “set cookie” content = “cookie value = XXX; expires = Friday, 12-jan-200118:18:18gmt; path = / >

Note: the time format of GMT must be used.

E. Window target (display window setting)

Description: force the page to display as a separate page in the current window.

Usage: < metahttp equiv = “window target” content = “_ top”>

Note: it is used to prevent others from calling their own pages in the frame.

F. Content type (display character set setting)

Description: set the character set used by the page.

Usage: < metahttp equiv = “content type” content = “text / HTML; charset = GB2312” >

G. Content language (setting of display language)

Usage: < metahttp equiv = “content language” content = “zh CN” / >

H. Cache control specifies the caching mechanism that requests and responses follow.
Cache control specifies the caching mechanism that requests and responses follow. Setting cache control in a request message or a response message does not modify the cache process in another message process. The cache instructions include no cache, no store, Max age, Max stale, min fresh and on

The instructions in the response message include public, private, no cache, no store, no transform, must revalidate, proxy revalidate and Max age. The instructions in each message have the following meanings
Public indicates that the response can be cached by any cache
Private indicates that all or part of the response message for a single user cannot be processed by the shared cache. This allows the server to describe only part of the user’s response message, which is invalid for other users’ requests
No cache indicates that the request or response message cannot be cached
No store is used to prevent important information from being released unintentionally. Sending in the request message will make the request and response messages do not use caching.
Max age indicates that the client can receive a response with a lifetime of no more than a specified time (in seconds)
Min fresh indicates that the client can receive a response with a response time less than the current time plus a specified time
Max stale indicates that the client can receive response messages beyond the timeout period. If you specify the value of the max stale message, the client can receive response messages that exceed the specified value of the timeout period.

How to use meta tags

Meta tag is a language used to describe the properties of web pages. The standard meta tag can facilitate the ranking of search engines and improve the weight ranking of search engine websites. If you want the website to be more in line with the search engine standards, you must understand the meta tag. Let’s talk about the meaning and usage of the meta tag by SEOER

1. Keywords of meta tag

The writing method is: < metaname = “Keywords” content = “information parameter” / >

The key words information parameter of the beat tag indicates what the keywords of the website are.

2. Description of meta tag

< metaname = “description” content = “information parameter” / >

The information parameter of the description of the meta tag represents the main content of the website and the general situation.

3. HTTP equiv = content typecontent = “text / HTML” of meta tag

HTTP equiv = content type represents the HTTP header protocol, which prompts the information of the browser web page,

< metahttp equiv = “content type” content = “text / HTML; charset = information parameter” / >

When the charset information parameter of meta tag is GB2312, it means that the website adopts simplified Chinese coding;

When the charset information parameter of meta tag, such as BIG5, indicates that the website adopts traditional Chinese coding;

When the charset information parameter of meta tag is iso-2022-jp, it means that the website adopts Japanese encoding;

The charset information parameter of meta tag, such as KS_ c_ 5601, the representative indicates that the website adopts Korean code;

When the charset information parameter of meta tag is iso-8859-1, it means that the website adopts English coding;

The charset information parameter of meta tag, such as UTF-8, represents the universal language code;

4. Generator of meta tag

< metaname = “generator” content = “information parameter” / >

The information parameter of the generator of the meta tag indicates what software is used to make the website.

5. The author of meta tag

< metaname = “author” content = “information parameter” >

The information parameter of the author of the meta tag represents the information about the copyright author of the web page.

6. HTTP equiv = “Refresh” of meta tag

< metahttp equiv = “Refresh” content = “time; url = URL parameter” >

The refresh of meta tag represents how long the web page will be automatically refreshed, and the URL parameter in URL represents how long it will be automatically linked to other web addresses.

7. Http-equiv = “pragma” content = “no cache” of meta tag

< metahttp-equiv = “pragma” content = “no cache” > means that the browser is forbidden to access the page content from the cache of the local computer. In this way, the visitors will not be able to browse offline.

8. Copyright of meta tag

< metaname = “copyright” content = “info parameter” >

The information parameter of copyright in the meta tag indicates the copyright information of the website.

9. HTTP equiv = “imagetoolbar” of meta tag

<metahttp-equiv=”imagetoolbar”content=”false”/>

Specifies whether to display the image toolbar. When it is false, it means not to display. When it is true, it means to display.

10. Content script type of meta tag

<Metahttp-equiv=”Content-Script-Type”Content=”text/javascript”>

W3C web page specification, indicating the type of script in the page.

11. Review after of meta tag

<METAname=”revisit-after”CONTENT=”7days”>

Visit after represents revisit, 7days represents 7 days, and so on.

12. Robots < metaname = “robots” contect = “information parameter” > of meta tag

The robots representative tells the search engine which pages the robot grabs

The properties are described below

The information parameter is all: the file will be retrieved and the links on the page can be queried;

The information parameter is none: the file will not be retrieved, and the links on the page cannot be queried;

The information parameter is index: the file will be retrieved;

The information parameter is follow: the links on the page can be queried;

The information parameter is Noindex: the file will not be retrieved, but the link on the page can be queried;

The information parameter is nofollow: the file will be retrieved, but the link on the page cannot be queried;