How to implement automatic conversion of uploaded images to WebP format to optimize front-end loading and display speed?

Calendar 👁️ 113

In today's content operation, website loading speed is crucial for user experience and search engine ranking.Images are an important part of web content, and their loading performance is often a key factor affecting overall speed.AnQiCMS (AnQiCMS) fully understands this, providing a convenient image optimization feature, especially the automatic conversion of images uploaded to WebP format, which can significantly improve the display speed of the website's front-end.

WebP format: a speed booster for front-end loading

WebP is an image format developed by Google, designed to provide high-quality images with smaller file sizes.Compared to traditional JPEG and PNG formats, WebP images can typically reduce file size by 25% to 35% or even more while maintaining visual quality.This means that when your website images are in WebP format, visitors will spend less time downloading the images, and the web page loading speed will naturally be faster.Faster loading speed not only improves user satisfaction and reduces the bounce rate, but is also one of the key considerations for search engine optimization (SEO).

How does AnQi CMS implement automatic WebP image conversion?

The AnQi CMS integrates image optimization into its core functions, allowing users to easily convert images to WebP without complex additional configurations or third-party tools.This feature can be found and enabled in the "Content Settings" in the background.

To enable this feature, you need to go to the Anqi CMS backend management interface and navigate toGlobal Settingsand then clickContent settings. On this page, you will see a name calledWhether to enable Webp image formatThe option. Tick the enable option and the system will automatically convert the new JPG or PNG images you upload to WebP format.This greatly simplifies the image optimization process, ensuring that new content on your website can enjoy the performance benefits of WebP immediately.

It should be noted that this setting will only take effect for newly uploaded images after it is enabled. If there are a large number of non-WebP format images already on your website and you want them to be converted to WebP for comprehensive optimization, Anqi CMS also provides a convenientWebP conversion tool. You can use this tool to batch process the uploaded images, convert all images on the website to WebP format, and thus achieve comprehensive image loading speed improvement.

Image optimization is not just WebP: companion features improve loading speed

In addition to WebP conversion, Anqi CMS also provides a series of complementary image optimization features to ensure the website loading speed.

  1. Automatically Compress Large ImageIf the images on your website are large and you do not want them to take up too much storage space or slow down the loading speed, you can enable the option 'Whether to automatically compress large images'.After turning on, the system will resize the image proportionally to the specified width as set by you, further reducing the file size.
  2. Thumbnail Processing MethodThe AnQi CMS supports various thumbnail generation methods, such as proportional scaling by the longest side, padding by the longest side, and cropping by the shortest side, etc.You can flexibly set the thumbnail size and generation method according to the design requirements of the front-end page to ensure that images can be displayed efficiently in different scenarios and avoid loading unnecessary full-size images.

These features can be combined to optimize images from multiple dimensions such as image format, file size, and dimensions, bringing a smoother and faster browsing experience to website visitors.

How to view and verify the WebP effect?

After you have enabled the WebP conversion feature, you can verify whether the image has been successfully converted to WebP format and is effective:

  1. Browser developer tools: Open your website, press F12 to enter the browser developer tools, switch to the "Network" tab. Refresh the page and click on the loaded image file to check if its "Type" or "Content-Type" is displayed asimage/webp.
  2. Online website performance testing toolUse Google PageSpeed Insights, Lighthouse, and other tools to analyze your website.These tools will evaluate the image optimization of the website and will usually give optimization suggestions such as 'encode the image as WebP', if your image is already in WebP, this part of the suggestion will usually disappear or score very high.

How to use these optimized images in the template?

The Anqi CMS offers a very flexible way to call images in templates. Whether the images are converted to WebP or not, you can easily call them with a unified tag. For example, on the document detail page or list page:

  • Cover image: Can pass through{{item.Logo}}(Cover main image),{{item.Thumb}}(Cover thumbnail) or by looping{{item.Images}}To call the cover group image. These images will be automatically output in WebP format after enabling WebP conversion in the background.
  • Image in content editorIn the document content:ContentThe image inserted in the field will also be automatically provided in WebP format after the WebP conversion is enabled. Furthermore, you can combine it in the template.lazyParameters, implement image lazy loading to further optimize page loading performance. For example:
    
    {% archiveDetail articleContent with name="Content" lazy="data-src" %}
    {{articleContent|safe}}
    
    Herelazy="data-src"It will load images according to the configuration of your front-end lazy loading plugin.srcattribute is replaced withdata-srcOr specify other properties to achieve the effect of loading images only when they enter the visible area, greatly reducing the burden on the initial page load.

Through these powerful and convenient image optimization features provided by AnQi CMS, you can easily transform technical details into tangible user experience improvement.From one-click settings in the background to intelligent loading on the front end, AnQiCMS gives your website an advantage in speed competition, providing visitors with faster and smoother browsing experiences.


Frequently Asked Questions (FAQ)

1. Why did I enable WebP conversion, but some images on the website are still in JPG or PNG format?The AnQi CMS's WebP automatic conversion feature is enabled by default only after turning on the settingNew uploadThe image will take effect. If there are many non-WebP image formats on your website, they will not be automatically converted. You can do this through the background management ofWebP conversion toolTo process these historical images in bulk, convert them to WebP format, and optimize the images across the entire site.

2. What if the user's browser does not support the WebP format after enabling WebP conversion?The WebP format is currently widely supported by the majority of modern browsers (such as Chrome, Firefox, Edge, Safari, etc.).The AnQi CMS has fully considered the image compatibility in its design. In most cases, even if the browser does not support WebP, the system will have an intelligent degradatioHowever, considering that a very few very old browsers may not be supported, it is recommended that you perform compatibility testing before the website goes live.For the vast majority of users, WebP will bring a seamless and faster experience.

3. What is the difference between WebP conversion and image compression? Do I need to enable them both?WebP conversion is aimage formatOptimization, it changes the image encoding method, thus obtaining smaller files under the same quality. Image compression is the process ofexisting image formatsIn formats like JPEG or PNG, or in WebP, adjust the image quality to reduce file size.They are complementary optimization methods. Anqi CMS recommends enabling WebP conversion and image compression features simultaneously, so that deep optimization can be performed at both the image format and file size levels, to maximize the speed of image loading.

Related articles

How to remove spaces or specified characters from the beginning, end, or all positions of a string and then display it?

In website content operation, we often encounter situations where strings contain unnecessary spaces or specific characters.These seemingly minor issues may affect the display aesthetics, SEO effects, and user experience of the content.For example, a product title may display differently on different devices due to leading and trailing spaces, or a keyword list may be surrounded by additional symbols, affecting search engine recognition.

2025-11-08

How to calculate the number of times a certain keyword appears in a string or array and display it?

In the daily work of content operation, we often need to conduct in-depth analysis of website content, one of the common requirements is to understand the frequency of a keyword appearing in a specific string or content block.This is crucial for SEO optimization and also helps us evaluate the relevance and quality of the content.AnQi CMS as an efficient enterprise-level content management system provides us with very convenient built-in tools to solve this problem, that is the powerful `count` filter.

2025-11-08

How to determine if a string, array, or map contains a specific keyword and display the boolean result?

In AnQi CMS template development, we often need to dynamically adjust the display of the page based on the specific attributes or keywords of the content.For example, determine whether an article title contains a certain word, whether a product category is in a certain list, or whether a configuration item exists.The powerful template engine of AnQi CMS provides various filters and operators, which can help us easily implement these judgments and obtain clear boolean (True/False) results.Let's delve deeper into how to implement these flexible judgments in Anqi CMS.### Core Function

2025-11-08

How to display user registration or group details (such as username, level, avatar) on the front page?

In website operation, displaying rich user-related information on the front page is an effective way to enhance user experience and community activity.Whether it is displaying the author's avatar, the user's level, or the username at registration, these personalized details can make the website more vibrant.AnQiCMS as a powerful content management system provides us with very flexible template tags and data call capabilities, making the display of this information easy and simple.### Understand AnQiCMS user and group data In the AnQiCMS backend

2025-11-08

How to batch regenerate all content thumbnails to fit the new frontend display size?

When the visual style of a website needs a complete overhaul, or to adapt to the ever-changing size of device displays, we often need to adjust the size of image thumbnails.AnQiCMS (AnQiCMS) fully understands this and provides a convenient and efficient solution for such needs.How to batch regenerate thumbnails for all content in response to adjustments in front-end display dimensions to ensure the aesthetic beauty and loading efficiency of the website, which is a concern for many operators.Why do you need to regenerate the thumbnail? Thumbnails play a crucial role in website operations

2025-11-08

How to set up the website to display specific notification information on the front end when it is in "closed site" status?

The website will always encounter times when it needs to be maintained, upgraded, or temporarily adjusted.At this moment, it is crucial for users to see a friendly and clear prompt instead of a cold error page, which is vital for the image and user experience of the website.Fortunately, AnQiCMS provides a very convenient and flexible "shutdown" function, allowing you to easily manage the maintenance status of the website and display customized notification information to front-end visitors.Next, let's take a look at how to set the "shutdown" status of the website in the AnQiCMS backend

2025-11-08

How to display recommended attributes (such as headlines, recommendations, sliders) in article lists or detail pages?

In AnQi CMS, in order to make your website content more attractive and able to flexibly display articles of different importance levels or display forms, the system provides a "recommended attribute" feature.By cleverly utilizing these properties, you can easily add "headlinesThis guide will take you in-depth to understand how to set and use these recommended properties in AnQiCMS, making your website content management more convenient.

2025-11-08

How to display a custom Banner image group on the category page or single page?

It is crucial that visual content is attractive in website operation.Especially for category pages and standalone single pages, displaying a set of carefully designed banner images can effectively attract visitors' attention, strengthen the brand image, and convey specific information.AnQiCMS provides a straightforward and flexible mechanism that allows you to easily configure and display custom Banner image groups on these key pages.

2025-11-08