[Solved] How to make LiteSpeed LScache Plugin for Wordpress avif ready?

serpent_driver

Well-Known Member
#1
Do you know avif?
avif stands for AV1 Image File Format, is a modern, open-source image compression format. The AVIF format is based on the AV1 video codec, which was developed by the Alliance for Open Media (AOMedia) to provide efficient and high-quality video compression. The AVIF format leverages advanced compression techniques employed by the AV1 codec to deliver exceptional image quality at a fraction of the file size of traditional image formats, such as JPEG and PNG.

The main key feature of avif image is that the file size of avif images can be up to 50% smaller in comparison to webp image format without loss of quality.

So why not use avif images instead of webp?
avif image format is not an replacement of webp images and webp is not an replacement of avif, because not all browsers support both image format types, so you must offer both image types and at least there are browsers that doen't support webp nor avif. While this only affects older browsers, old is relative. The Safari browser itself only supports webp since version > 13 and only with certain OS versions. The avif format looks even worse with regard to the Safari browser, so that at least version 16.4 is required for unrestricted avif support. All other of the most used browsers such as the Chrome Browser or Firefox have been able to use avif for much longer. An exception among the well-known browsers is the Edge Browser from Microsoft. Although this browser is based on the Chrome browser, this browser does not support the avif format to date.

[Update]
Since version 121 also the Edge Browser supports avif.

Although it may read as if avif is not an alternative to webp, due to the widespread use of the Chrome browser, Firefox and other browsers, it can be assumed that the majority of all users will benefit from the advantages of the avif format.

How can I use avif images?
Regardless of Wordpress and the LiteSpeed LScache Plugin (LSCWP) for Wordpress, HTML5 provides everything to not only use webp but also avif images, provided that you are able to convert the existing jpg or png images into the webp and/or avif convert format. Not only for Wordpress there are numerous plugins that convert jpg and png images. With these plugins you get the required image formats in the simplest way, but the biggest weakness of the plugins we know is that they are only insufficiently able to detect the browser support of webp and avif images. As a result, users of the Safari browser in particular, who support neither webp nor avif, still see one of the two image formats, although there is no support for it. No support means that the affected browsers will not display any images. HTML5 can solve this problem, but none of the themes we know of provide the necessary HTML code to take advantage of webp and avif without running the risk of providing a browser with the wrong image format.

That sounds very complicated. Isn't there a little easier way?
Unfortunately no and to your disappointment it gets even more complicated when you use the LiteSpeed Cache plugin. However, this thread was not written to ruin your day. This thread has a happy ending, but you should know why it was very difficult to resolve the issue. So hold on and read this thread to the end. It is worth it...!!!

Why is it particularly difficult to use avif images with the LiteSpeed Cache Plugin for Wordpress?
Basically, the same problems exist with the LScache plugin as without the LScache plugin. However, these are enormously expanded by the cache function, whereby at first it does not matter whether it is about webp or avif. In order to make the webp format available in Wordpress, you first need quic.cloud, because the webp images are not created by the plugin, but by quic.cloud. If you don't have a paid plan with quic.cloud, the time to convert the original images can take a long time because there is a daily limit of 200 images. If you overlook this, you get the webp images you need through quic.cloud, but even these webp images have limitations. Restriction means that LiteSpeed does not optimize the webp images, but only converts them. There is no compression involved in this conversion, which finally explains why the webp version of a jpg image has a larger file size than the original jpg image. As a result of this and due to the programming, the image format with the smallest file size is displayed. It is not uncommon for this not to be the webp image, but the jpg (original) image.

In the LiteSpeed Cache plugin, the use of webp images is provided via the webp replacement function. This replacement not only simply replaces the original image, but also changes the extension of the image in the HTML code. Image.jpg becomes image.jpg.webp. In relation to the cache function, this means that at least 2 different cache copies are required so that a browser with and without webp support can display the appropriate HTML code or cache copy. Thanks to the cache vary feature of the LiteSpeed web server's LScache engine, this is possible without any problems, but the LScache plugin for Wordpress generates faulty and incomplete cache vary modRerite rules in the .htaccess. As a result of this flaw, incorrect cache vary are created, causing either the correct browsers to display the wrong images, or the built-in cache warmup crawler warming up the wrong cache. Ultimately, this programming, which has been faulty for many years, means that the cache function and thus the speed advantage when loading a page is downright worthless. However, this does not only apply if the webp replacement function is enabled, but also when the webp replacement function is deactivated by activating the guest mode. What the guestmode paradox is all about, however, is another matter entirely.

When will the solution finally come that I can use avif images with the LScache plugin for Wordpress?
The answer to this question is that you cannot use avif images as long as LiteSpeed does not create the conditions for it. Referring to a comment by the LiteSpeed chief developer in LiteSpeed Slack, LiteSpeed has no plan to add the avif function to the LiteSpeed cache plugin. But don't worry. The world around LiteSpeed is much bigger than you and LiteSpeed might like to believe.




With the AWR Plugin for LiteSpeed LScache for Wordpress all previously described problems are solved. AWR stands for "avif & webp Replacement with Image Optimization". From this name of the plugin you can already conclude that it not only replaces the webp replacement function of the LScache plugin. It also provides the seemingly impossible avif replacement and also optimizes your default images. These functions are crowned by the fact that you do not need an external service like quic.cloud. All optimizations and conversions are done on your own server if your server meets the necessary requirements. Although these are small, the optimization of images in particular creates a very high server load. In order not to let the load become too high during the image process, the AWR plugin provides several functions so that you can also use the AWR plugin on shared hosting.

The AWR plugin was specially programmed for the LiteSpeed LScache plugin for Wordpress. It only works with this cache plugin and no other plugin.

The AWR plugin also offers you numerous "LiteSpeed Hacks". These hacks are modifications of the LScache plugin for Wordpress, which make it possible, for example, to make the built-in crawler avif ready, to "unblock" a crawler blocked by the hosting provider, or to make the built-in crawler more performant and therefore faster. In addition, these hacks make the built-in crawler "decimal numbers ready". The culmination of these hacks is a replacement of the lazy load and VPI function of the LScache plugin, which once again makes quic.cloud superfluous and less Javascript is required thanks to an improved lazy load. These hacks are supplemented by the so-called Fetch Priority Property, which has a significant impact on the prioritization of static sources to be loaded and prevents Content Shifting (CLS). These hacks not only give you more functions, they also save you a lot of time and money for quic.cloud.

We hope we didn't take up too much of your time, but we think it was worth reading this thread.

Learn about the AWR Plugin at the Kitt Cache Crawler page, the fastest Cache Crawler for LiteSpeed LScache.

https://www.cachecrawler.com/WP-Plugins/WP-Plugin-avif-webp-Replacement::6574.html

*************************************************************************************************************************************************************************************************
Join https://www.cachecrawler.com - Lightning fast Cache Warmup Crawler for Wordpress, OpenCart, PrestaShop, W3 Total Cache, WP Rocket, Shopware and Magento.
 
Last edited:

serpent_driver

Well-Known Member
#3
Why useless? If your server doesn't meet the requirements, then that's not the plugin's problem. If you want to remove it, then uninstall it like any other WordPress plugin.
 

Yogurteg

Active Member
#4
Yes, yes, I didn’t expect any other answer from you, to be honest)) Well, let’s wait a couple of years until someone else writes a review of your impeccable plugin.
 

serpent_driver

Well-Known Member
#5
It would be helpful for you, for me and for everyone else who is interested if you would describe why you are having problems with the plugin. Pointless insults help no one. If a demo of this plugin is available so that you can convince yourself that the plugin works without any problems, then it will be difficult to believe your insults. Nevertheless, I cordially invite you to explain your insults. If many other users have no problems with this plugin, why shouldn't it work for you too?

Again, describe the problems and we will be happy to help you!
 
#6
Hi Serpent, seperate person. I'd like to start using wordpress from the Azure litespeed server package. I was wondering if you expect I need to do certain things to meet the requirements from its default install? I'm about to set it up. Avif images falling back to webp is my goal.

I'll post the requirements here from the plug's website for others:


The system requirements for using the AWR plugin are actually not very high. With shared hosting, however, there are sometimes restrictions that prevent this. You should therefore check before installing whether your server meets the requirements. At the latest after installation, you will be shown whether your server is suitable for using the AWR plugin. If your server does not meet all the requirements, there are unfortunately no alternatives. Maybe you should change the hosting provider.

  • /proc/meminfo must be readable
  • sys_getloadavg() PHP Function must be readable
  • Imagick() class must exist
  • LiteSpeed web server must be installed
  • LiteSpeed Cache Plugin must be installed
  • /proc/cpuinfo must be readable
  • /proc/stat must be readable.
 

serpent_driver

Well-Known Member
#7
Hi @hazelbrookcatshelter , I am not a snake, but a serpent driver and the term serpent comes from this. https://www.serpent.com:)

The requirements of the AWR plugin are not unusual, at least not in a typical hosting environment. This also applies to shared hosting because the AWR plugin was programmed with a focus on the limited conditions of shared hosting. Even if you don't use shared hosting, there are minimum requirements that you must activate on your server if necessary if you are the admin on your server. If your server does not meet the requirements, the plugin will show you this. So if you have problems with the requirements, you would need to give me a few details to help you.

Regarding your goal that there is a fallback if avif is not supported, then this fallback is guaranteed by the AWR plugin. However, at least with current browsers there is no longer any need for a fallback because all current browsers now support both the webp and avif format.

https://caniuse.com/webp
https://caniuse.com/avif
 
Last edited:
#9
Hey that didn't work activating sorry. I set up the Azure litespeed server, updated and installed wordpress, activated LiteSpeed Cache and checked all the prerequirements were met. I tried to activate in the wordpress plugin section but I get the error 'Plugin could not be activated because it triggered a fatal error. ' Are you able to help me privately or should we talk about it here?
 
#11
@serpent_driver, I didn’t insult you (even though you are a Nazi), I just wrote that the plugin doesn’t work. You immediately started making excuses that it was supposedly my server’s fault, haha. You immediately started making excuses that it wasn’t your plugin’s fault, haha. You should actually be grateful that I attracted the attention of a living person to your trinket. But of course I don't expect this from you)
If many other users have no problems with this plugin, why shouldn't it work for you too?
Yeah, we are not alone!
 

serpent_driver

Well-Known Member
#12
Do you want me to take you seriously? I'm trying to help you, but you don't give anything more than nonsensical comments. If you want people to help you, then you should be a little more cooperative. Don't you think so?
 
#13
@serpent_driver, It feels like you are writing about yourself)) I don't take you seriously, so you might as well take me too.
You should focus less on the early hints and more on your president. There are users from one country in this forum who would start a shitstorm if they knew which country you are from.
Very responsive, important and cooperative comment, yeah, haha))
 

serpent_driver

Well-Known Member
#16
Hey that didn't work activating sorry. I set up the Azure litespeed server, updated and installed wordpress, activated LiteSpeed Cache and checked all the prerequirements were met. I tried to activate in the wordpress plugin section but I get the error 'Plugin could not be activated because it triggered a fatal error. ' Are you able to help me privately or should we talk about it here?
After extensively checking the server requirements, almost everything indicates that the missing prerequisites are the cause of the error. However, a final result will only be available once the missing functions have either been activated or installed.
 

serpent_driver

Well-Known Member
#17
Issue solved

After all missing requirements have been met by activating or reinstalling functions, it can now be said with final certainty that the AWR plugin is error-free and the functional problems at @hazelbrookcatshelter were due to the fact that not all requirements were met.

The AWR plugin checks these requirements, but this requires proper installation. For reasons that cannot yet be determined, something is bothering WordPress, which is why there is an error during installation. As a consequence of this experience, we will include a test script with the AWR plugin, with which you can check whether all requirements are met before installation.

However, it must be emphasized that any problems during installation are not the norm. If there are problems, then these problems are limited to OpenLiteSpeed, because OLS does not contain all functions by default and you have to install one or the other function later. It was the same with @hazelbrookcatshelter. It is very likely that the installation problems occurred due to the missing Imagick class, which is essential for converting images into the webp and avif format.

It can be assumed that the user @Yogurteg had the same cause, but this user refuses any assistance.
 
Last edited:

serpent_driver

Well-Known Member
#20
@Yogurteg

If you were unable to install the AWR plugin, then there must be an error entry in the debug.log. This would at least provide a reference to what may have gone wrong during the installation. But I suspect that it is because ImageMagick is missing on your server or an outdated version is installed. It's up to you, but if you want to know the cause, then use the attached AWR Tester Script. Upload the script to your server, place it in the root directory of your domain and request awr-tester.php in the browser.
 

Attachments

Last edited:
Top