Skip to main content

PageSpeed Caching

Overview

PageSpeed (mod_pagespeed) is a powerful tool that optimizes your website's content to load more quickly by applying a variety of filters. These filters help reduce latency by minifying scripts, inlining CSS, and automatically deferring JavaScript to avoid blocking DOM rendering. This results in a faster browsing experience, improving visitor engagement and overall site performance.

Availability

PageSpeed is available on our platform and is enabled by default, ensuring that your website is optimized out of the box.

You can adjust PageSpeed settings directly from the control panel. Navigate to Web > Site Optimizer to access and configure your PageSpeed filters.

Filter Usage

PageSpeed operates through a modular filter system, allowing you to add or remove specific filters to tailor optimizations to your needs. These filters can be controlled via the .htaccess file in your document root. By default, all filters listed under CoreFilters are enabled.

How to Add or Remove Filters

To modify filters in your .htaccess file:

  1. Create a .htaccess file in your document root if it doesn't already exist.
  2. To add filters, use:
    ModPagespeedEnableFilters filtera,filterb
  3. To remove filters, use:
    ModPagespeedDisableFilters filtera,filterb
  4. After committing these changes, the specified filters will be added or removed from CoreFilters.

Filter List

Below is a comprehensive list of available filters, indicating whether they are included in CoreFilters (CF) or OptimizeForBandwidth (OFB). Each filter name links to its detailed documentation.

Filter NameIn CFIn OFBDescription
add_headYesNoAdds a <head> element to the document if not already present.
combine_headsNoNoCombines multiple <head> elements into one.
inline_import_to_linkYesNoConverts <style> tags with only CSS @imports to <link> tags.
outline_cssNoNoExternalizes large CSS blocks into a cacheable file.
outline_javascriptNoNoExternalizes large JS blocks into a cacheable file.
move_css_above_scriptsNoNoMoves CSS elements above <script> tags.
move_css_to_headNoNoMoves CSS elements into the <head>.
combine_cssYesNoCombines multiple CSS elements into one.
rewrite_cssYesYesMinifies and optimizes CSS files.
fallback_rewrite_css_urlsYesNoRewrites non-parsed resources in CSS files.
rewrite_style_attributesNoNoApplies rewrite_css to style attributes.
rewrite_style_attributes_with_urlYesNoRewrites style attributes containing url(.
flatten_css_importsYesNoInlines CSS by flattening all @import rules.
prioritize_critical_cssNoNoReplaces CSS tags with inline critical CSS.
make_google_analytics_asyncNoNoConverts Google Analytics API to asynchronous.
rewrite_javascriptYesYesMinifies and optimizes JavaScript files.
rewrite_javascript_externalYesYesRewrites external JavaScript files.
rewrite_javascript_inlineYesYesRewrites inline JavaScript blocks.
include_js_source_mapsNoNoAdds source maps to rewritten JavaScript files.
combine_javascriptYesNoCombines multiple script elements into one.
canonicalize_javascript_librariesNoNoRedirects JavaScript libraries to a hosting service.
inline_cssYesNoInlines small CSS files into the HTML document.
inline_google_font_cssNoNoInlines CSS from fonts.googleapis.com.
inline_javascriptYesNoInlines small JavaScript files into the HTML document.
local_storage_cacheNoNoCaches inlined resources in HTML5 local storage.
insert_gaNoNoAdds the Google Analytics snippet to each HTML page.
rewrite_imagesYesYesOptimizes images by re-encoding and inlining small images.
convert_jpeg_to_progressiveYesYesConverts large JPEGs to progressive format.
convert_png_to_jpegYesYesConverts GIF and PNG images to JPEGs if compression artifacts are not significant.
convert_jpeg_to_webpYesYesProduces WebP images instead of JPEGs for supported browsers.
convert_to_webp_losslessNoNoReplaces GIF and PNG images with WebP format on supported browsers.
insert_image_dimensionsNoNoAdds width and height attributes to <img> tags.
inline_imagesYesNoInlines small images as data URLs.
recompress_imagesYesYesRecompresses images, removing metadata and transforming GIFs to PNGs.
resize_imagesYesNoResizes images based on <img> tag dimensions.
resize_rendered_image_dimensionsYesNoResizes images based on rendered dimensions.
inline_preview_imagesNoNoUses low-quality placeholders for images.
resize_mobile_imagesNoNoServes smaller placeholder images to mobile devices.
remove_commentsNoNoRemoves comments from HTML files.
collapse_whitespaceNoNoRemoves excess whitespace from HTML files.
elide_attributesNoNoRemoves insignificant attributes from HTML tags.
extend_cacheYesNoExtends cache lifetime for resources with a content hash.
sprite_imagesNoNoCombines background images in CSS into a sprite.
rewrite_domainsNoNoRewrites resource domains based on settings.
trim_urlsNoNoShortens URLs by making them relative to the base URL.
remove_quotesNoNoRemoves unnecessary quotes around HTML attributes.
defer_javascriptNoNoDefers JavaScript execution until the page has loaded.
lazyload_imagesNoNoLoads images as they enter the viewport.
insert_dns_prefetchNoNoInserts <link rel="dns-prefetch"> tags to reduce DNS resolution time.

By understanding and utilizing these filters, you can significantly improve your website’s performance, making it faster and more responsive to user interactions.