Convert Meta Tags


The 'Convert Meta Tags' filter is enabled by specifying:

ModPagespeedEnableFilters convert_meta_tags
pagespeed EnableFilters convert_meta_tags;

in the configuration file, but it is also enabled automatically by the core filter set.


The 'Convert Meta Tags' filter adds a response header that matches each meta tag with an http-equiv attribute. For example, HTML

<meta http-eqiv="Content-Type" content="text/html; charset=UTF-8">
would add an HTTP header:
Content-Type: text/html; charset=UTF-8
in the response headers.

The original tag is left unchanged.

Certain http-equiv meta tags, specifically those that specify content-type, require a browser to reparse the html document if they do not match the headers. By ensuring that the headers match the meta tags, these reparsing delays are avoided.


This filter is considered minimal risk because at this time, Content-Type is the only http-equiv value that is transformed into an HTTP header. Other http-equiv values have been found to have unexpected semantic implications when transformed to HTTP.