"Fossies" - the Fresh Open Source Software Archive

Member "incubator-pagespeed-mod-1.14.36.1/html/doc/filter-pedantic.html" (28 Feb 2020, 2961 Bytes) of package /linux/www/apache_httpd_modules/incubator-pagespeed-mod-1.14.36.1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the incubator-pagespeed-mod-1.14.36.1.tar.gz project site itself.

Pedantic

Configuration

The 'Pedantic' filter is enabled by specifying:

Apache:
ModPagespeedEnableFilters pedantic
Nginx:
pagespeed EnableFilters pedantic;

in the configuration file.

Description

The 'Pedantic' filter is used to make PageSpeed more HTML4 compliant. Some filters remove type attributes in style and script tags, which are required for HTML4 validation checks but not HTML5. This filter adds default types to script and style tags. Note that it will increase HTML size and thus possibly increase latency so use it only if you require HTML4 validation.

Operation

There are two cases where a type attribute can be added. First, if a <style> tag does not have a type attribute then a type="text/css" attribute will be added to the style tag. Second, if a <script> tag does not have a type attribute then a type="text/javascript" attribute will be added to the script tag.

The expected method of using the pedantic filter is via a query parameter such as: '?ModPagespeedFilters=+pedantic'.

You can see the filter in action at www.modpagespeed.com on this example.

Requirements

The 'Pedantic' filter will not alter a page with an HTML5 DOCTYPE.

Risks

This filter is considered medium risk. It is safe for most pages, but could possibly break scripts by adding text/javascript to a tag if the default mime type is something other than text/javascript.