perf 2.0.95
format
specifies the format for the image in question.
Configures the format parameter for the image in question. Does not modify the attribute directly.
Instead, it should be called within a optimize_image
yield. The optimize_image
function does the actual modifications. Valid options include gif (non-animating), jpeg, png, and webp
height
specifies the height modifier for the image in question.
Configures the height parameter for the image in question. Does not modify the attribute directly.
Instead, it should be called within a optimize_image
yield. The optimize_image
function does the actual modifications.
quality
specifies the width modifier for the image in question.
Configures the quality parameter for the image in question. Does not modify the attribute directly.
Instead, it should be called within a optimize_image
yield. The optimize_image
function does the actual modifications. Quality should be a float between 0 and 100. 100 is the highest quality, but is not recommended - images usually are larger than their source images at that setting. A good place to start is 70 - usually you cannot see a visual difference at that level.
width
specifies the width modifier for the image in question.
Configures the width parameter for the image in question. Does not modify the attribute directly.
Instead, it should be called within a optimize_image
yield. The optimize_image
function does the actual modifications.
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
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.
clear_ignore_domain
clear_ignore_domain
resets the blacklist of domains we will not bundle.
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.
optimize_all_js
bundles all adjacent js on a page.
This function finds all adjacent javascript and bundles the JS. It does this by using the Moovweb js bundling service, which takes as input a list of urls (in query parameters) and returns the concatenated JS.
optimize_image
modifies the image's src attribute to optimize the image
The src attribute is modified to point at the image optimization service (opt.moovweb.net/img...) The query parameters specify how to optimize the image.
optimize_image
modifies an image's attribute to optimize the image
Same functionality as the optimize_image
function, but lets you specify which attribute to set. Most often this is used in combination w image deferral, when the image's src is renamed as data-src
so that the image doesn't get requested on load.
set_ignore_attribute
specify an attribute that serves as a flag that indicates the script will not be bundled
Call this function in the scope opened by optimize_all_js
to set an attribute
which will not be bundled by the optimizer (this will also terminate the chain of scripts)