Images settingsAccelerator for WordPress

settings-Images

General#

  • Detect changes

    It is useful when images are changed in time. It forces to drop browser cache by appending time marker parameter to the image’s URL.

    Note. If compression auto-redirection is enabled then time marker will be used from the last modified compressed file.

  • Adjust attachments’ URLs

    Process images at an early stage (before full HTML of pages is generated). This makes it possible to process images that are not placed in standard img tags or styles.

    Warning. May be incompatible with some themes or plugins.

  • Inline smaller than

    Inlines small images into HTML and CSS to decrease request count to our server.

Compression#

Enables compression of JPG, PNG, GIF and BMP images except animated GIF and PNG ones. It creates compressed images for original ones.

E.g. for image1.png will be created file image1.png.webp. If compressed file can’t be created or not needed (e.g. it is larger) then image1.png.webp.json will be created with the reason inside.

  • Enable WebP

    Enables creating of WebP compressed files for original ones.

    • Quality

      Lower quality produces lower file size.

  • Auto-redirect to WebP version

    Adds some directives into the .htaccess file to redirect images to their WebP versions. E.g. if image1.png.webp exists then image1.png will be redirected to it.

  • Enable Avif

    Enables creating of Avif compression files for original ones. If Webp creation is enabled and Avif file is larger than Webp it won’t be written. Compressing to Avif can take long time so it is disabled by default.

    • Quality

      Lower quality produces lower file size.

    • Speed

      Lower speed produces lower file size but it can take a lot of time.

    Note. It is available from PHP 8.1 and upper and if the ‘GD’ extension is built with AVIF support. Or if ‘IMAGEMAGICK’ PHP’s extension is installed and supports AVIF. Or it is supported by special encoder from our side as a binary executable module (currently only Lunux x64 and Windows x64). It is automatically downloaded when needed from our site and executed. So, if PHP ‘proc_open’, ‘proc_close’, and ‘chmod’ functions are blocked, please, check your hosting PHP’s configuration.

  • Auto-redirect to Avif version

    Adds some directives into the .htaccess file to redirect images to their Avif versions. E.g. if image1.png.avif exists then image1.png will be redirected to it.

To enable auto-redirection to WebP and Avif version under NGINX the following directives should be added manually into the begin of server directive:

# seraphinite-accelerator - Automatic redirection to Avif and WebP versions if they exist
include /www/wwwroot/my-site.com/seraph-accel-img-compr-redir.conf;

And the /www/wwwroot/my-site.com should be replaced by your site’s root filesystem path.

Note. If external cache is enabled then images can be show with original versions. If so, please, clear the external cache.

Note. Compression is currently processed only for images that can be caught by content processing like HTML img tag and CSS url attribute.

Note. After changing the settings, you need to manually update the NGINX configuration.

Adaptation to screen sizes#

It decreases images size on smaller screen sizes like mobiles. It is better to show smaller images on smaller screens to decrease network traffic and increase loading speed. Adaptation is made to popular 360, 480, 768, and 1366 pixels wide screens.

  • Backgrounds

    All background images that defined in styles (inline or separated) will be processed.
    Note. Exclusions for separated styles can’t be added by item’s basis.

Excludes#

Element tags that are matching the specified XPath selectors will not be processed. E.g. the selector ./style[contains(text(),'img-01.jpg')] excludes all separated styles that contain img-01.jpg. Or e.g. the selector .//div[contains(@style,'img-02.jpg')] excludes all div tags with inline style that contains img-02.jpg.

Lazy load#

  • Add original size

    Just adds the original image’s width and height to the ‘img’ tag attributes.

  • Enable

    Enables this mode.

Excludes#

Image tags that are matching the specified XPath selectors will not be processed. E.g. to exclude first 5 images on all pages we should add .//img[position()<=5] expression.

Note: It applies to frames lazyloading too excluding adapted placeholder.

Cache external#

All external images’ URLs that are matched with defined patterns will be cached.

Leave a Reply