LiteSpeed Cache for WordPress Settings: Media

Looking for Image Optimization? Click here.

Learn more about Lazy Load on our blog.

Lazy Load Images


When enabled, this setting only loads the images that are visible in the viewport. The remaining images are only loaded as necessary when they scroll into view.

You can use CSS3 to make your lazy loaded images fade in gracefully. Here's how.

Lazy Load Image Excludes

empty string

Sometimes there are images that you want to load immediately no matter where they appear on the screen. Enter them here, one per line. You may use the full URI or a partial string. Partial strings come in handy if you have an entire directory of images that must be immediately loaded. Don't use wildcards here.

Lazy Load Image Placeholder

empty string

When Lazy Load Images is enabled, a gray box is displayed as a placeholder until an image can be loaded. If you'd prefer something more creative, you can specify your own base64 image. You can list the image here, or you can use the LITESPEED_PLACEHOLDER constant in your wp-config.php file. If both are defined, this setting takes precedence over the wp-config.php constant.

Lazy Load iframes


This setting behaves exactly as Lazy Load Images, only for iframes instead of images.

Optimization Cron


The Image Optimization features uses a cron job to control the fetching of optimized images from LiteSpeed's Image Server. If you disable this setting, you will always need to fetch newly-optimized images manually with the “Pull Images” button.

Optimize Original Images


When Image Optimization is run, JPG and PNG images will be optimized, and backups saved. For example, if the image image.jpg can be optimized a copy of it is saved in image.bk.jpg. Then, the newly-optimized version is saved back into image.jpg. Turn this option OFF, if you do not want optimized JPG and PNG files.

Optimize WebP Versions


If this option is ON, JPG and PNG images will be saved as the WebP format during Image Optimization. For example, the image image.jpg is converted to WebP format, and saved in image.jpg.webp. Leave this option OFF, if you do not want WebP versions of your images.

Optimize Losslessly


When JPG and PNG images are optimized, lossy compression is used by default. Turn this option ON to optimize using lossless compression. This can improve quality but may result in larger images than lossy compression will.

Preserve EXIF Data


An image's EXIF data may contain information about the camera equipment used to take the photo, copyright date and photographer, GPS coordinates, comments, keywords, etc. Because this information takes up space, the optimization process strips EXIF data by default. You can enable this option to preserve the data, but be aware that this will increase the optimized file size.

Image WebP Replacement


Turn this option 'ON' to use WebP images in place of JPG or PNG images, where available. This is a master switch. To control the use of WebP on an image-by-image basis, from the WordPress Dashboard, navigate to Media > Library, hover over the image in question, and you will see a WebP enable/disable toggle link.

Note: The WebP image format is not supported by all browsers. If an unsupported browser requests a page with WebP images on it, LSCache will serve a version with the original image file format to that browser.

WebP Attribute To Replace


This setting gives you the power to alter WebP Replacement behavior. The default values show where LiteSpeed automatically replaces JPG with WebP. The attributes are listed one per line using the format element.attribute or .attribute (element is optional).

Remove an attribute from the list if you do not WebP images replaced there. Add a new one to the list, if your site has an attribute we don't replace by default.

WebP For Extra srcset


If you have custom code on your site, and it adds srcset elements but it bypasses WordPress logic to do so, you'll need this setting turned ON. LiteSpeed knows to look for srcset elements that are generated through WordPress, but it won't replace WebP images in other srcset elements unless you tell it to.

litespeed_wiki/cache/lscwp/configuration/media.txt · Last modified: 2018/07/05 18:51 by Lisa Clarke