Fork me on GitHub

perf 2.0.105

node:

Attribute

mixer
perf 2.0.105
category
Image
{
Overview

format specifies the desired format for the optimized image.

Sets the format the that image optimizer will attempt to convert the current image to. This should be one of the following values:
* webp
* jpeg
* png
The image optimizer will passthrough unmodified any images it cannot convert, such as animated gifs. Also, invalid conversions, such as converting gifs with transparent pixels to jpeg will be passed through unmodified.
If the format is not specified, but the browser supports webp, the image optimizer will upgrade the image to webp. Otherwise, the image optimizer will attempt to compress the image to jpeg. If that fails, then the image will be passed through unmodified. This function must be called from within an optimize_image yield.

*
Argument
Type
Name
Text %format
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

Attribute

mixer
perf 2.0.105
category
Image
{
Overview

height specifies the desired height of the final image in pixels.

Sets the height (in pixels) that the image optimizer will scale the optimized image to. This should be a numeric value (with no units) in a string.
If height() is not called, then the height of the source image will be preserved. Currently, the image optimization service will:
* not preserve the aspect ratio of the original image
* not accept a height that is larger than the original image. Larger heights will be ignored
This function must be called from within an optimize_image yield.

*
Argument
Type
Name
Text %height
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

Attribute

mixer
perf 2.0.105
category
Image
{
Overview

quality specifies the desired quality for the optimized image.

Sets the quality parameter for the optimized image. This must be a numeric value (with no units). Decimals are valid, and the higher the number, the larger the file size and higher the quality of the output image. This value will be used only if the output encoding format uses compression and allows the user to specify a quality level. The valid range for quality is 0 - 100. It is not advisable to use a quality of 100, because this can lead the final image to be larger than the original source image. A good recommended starting point for quality is 70 - usually you cannot see a visual difference at that level. If the quality level is not specified, then the image optimizer backend will choose a default quality of 90 (currently). If the quality level does not apply to the selected encoding format, then it will be ignored. Compression using the image optimizer is additive, so if the source image was already compressed, the image optimizer will further compress it.
Currently, quality is only valid for the following formats:
* webp
* jpeg

*
Argument
Type
Name
Text %quality
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

Attribute

mixer
perf 2.0.105
category
Image
{
Overview

width specifies the desired width of the final image in pixels.

Sets the width (in pixels) that the image optimizer will scale the optimized image to. This should be a numeric value (with no units) in a string.
If width() is not called, then the width of the source image will be preserved.
Currently, the image optimization service will:
* not preserve the aspect ratio of the original image
* not accept a width that is larger than the original image. Larger widths will be ignored
This function must be called from within an optimize_image yield.

*
Argument
Type
Name
Text %width
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

Text

mixer
perf 2.0.105
category
Performance
{
Overview

elide_bool_attributes remove explicit values for boolean attribute from HTML elements

To save space and allow improved canonicalization, this function removes explicit values for boolean attributes that don't require them. Low risk, unless CSS or Javascript is targeting elements by explicit default values Adds support for newer attributes in HTML5 needs to be done after the html() scope has closed

*
This function has no arguments
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

XMLNode

mixer
perf 2.0.105
category
Javascript
{
Overview

add_ignore_domain adds a domain to a blacklist so that it will not be bundled

Call this function in the scope opened by optimize_all_js to set a domain which will not be bundled by the optimizer (this will also terminate the chain of scripts)

You can ignore multiple domains by calling this function multiple times in a scope, we concat the new ignore domain to the list of excluded domains each time

*
Argument
Type
Name
Text %domain_name
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

XMLNode

THE
async_js()
FUNCTION
mixer
perf 2.0.105
category
Javascript
{
Overview

async_js configures the optimized JS to be loaded asynchronously

async_js configures the optimized JS to be loaded asynchronously It applies to the new bundled script tag, not the existing script tags.

*
This function has no arguments
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

XMLNode

mixer
perf 2.0.105
category
Javascript
{
Overview

clear_ignore_domain

clear_ignore_domain resets the blacklist of domains we will not bundle.

*
This function has no arguments
»
View Source
node:

XMLNode

THE
defer_js()
FUNCTION
mixer
perf 2.0.105
category
Javascript
{
Overview

defer_js configures the optimized JS to be loaded asynchronously

defer_js configures the optimized JS to be loaded asynchronously It applies to the new bundled script tag, not the existing script tags.

*
This function has no arguments
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

Text

mixer
perf 2.0.105
category
Performance
{
Overview

elide_attributes remove default values from HTML elements

To save space and allow improved canonicalization, this function removes default values when they have been specified in the HTML. Low risk, unless CSS or Javascript is targeting elements by explicit default values

*
This function has no arguments
Explore more ways to use this function in our Tritium Tester
»
»
View Source
node:

Text

mixer
perf 2.0.105
category
Performance
{
Overview

insert_dns_prefetch adds a dns-prefetch attribute to elements that load assets

In browsers that support this attribute, this will prefetch the DNS for domains where assets referenced by src or href attributes are hosted, to improve loading speed This function needs to be called in an active project, so it will not work in the Tritium Tester

*
This function has no arguments
»
View Source