How does AnQiCMS handle images in document content to optimize front-end display (e.g., Webp, compression)?

Calendar 👁️ 51

Images are an essential part of a website's content, making the page more attractive and conveying richer information.However, if the image is not optimized, the large file size often leads to slow website loading, seriously affecting user experience and search engine rankings.It's good that AnQiCMS provides a series of powerful optimization features when processing images in document content, which helps us easily cope with these challenges and ensures that the front-end display is both beautiful and efficient.

When we talk about image optimization, it usually involves several key aspects: image format, file size compression, and size adaptation in different scenarios.AnQiCMS provides flexible and practical solutions in these aspects.

first, Enable WebP image formatIs a highlight of AnQiCMS image optimization. WebP is a modern image format developed by Google, which can significantly reduce file size while ensuring image quality, usually 25-34% smaller than JPEG images of the same quality, and 26% smaller than PNG images.In AnQiCMS, we can find the option 'Whether to enable Webp image format' under 'Content Settings' in the 'Background Settings'.Once we choose to enable, the system will automatically convert JPG or PNG images to WebP format when uploading them.This means that we don't need to manually convert, and new uploaded images can automatically enjoy the volume advantages brought by WebP.For those old images that have already been uploaded to the website but have not yet been converted to WebP, AnQiCMS also provides a "Webp conversion tool" for us to conveniently batch convert with one click, so that all the images on the entire website can be upgraded quickly.

secondly,Automatic image compression functionIt is crucial for handling large original images. Often, the images we upload come from high-pixel cameras or source files made by designers, which have resolutions and file sizes far beyond what the website actually needs.AnQiCMS provides the setting for 'Whether to automatically compress large images'.When we turn on this feature, the system will intelligently judge and compress images that are too large.To better control the compression effect, we can also customize 'Auto-compress to a specified width'.For example, if we set the width to 800 pixels, all large images with a width greater than 800 pixels will be proportionally compressed to ensure that the images are displayed clearly on the front end without using too much bandwidth, thereby improving the page loading speed.

In addition to WebP conversion and automatic compression, AnQiCMS is inthumbnail managementIt also performs well, which is especially critical for scenarios that require small image display on list pages, recommendation positions, and so on.In the 'Content Settings', we can configure the 'thumbnail processing method' and 'thumbnail size'.The system provides three thumbnail processing methods to meet different design requirements:

  • Scale proportionally to the longest sideThis method retains all the content of the image and scales the longest side of the image proportionally according to the set size to ensure that the image does not deform.
  • Fill the longest sideThis method will make the thumbnail size completely match the width and height we set. If the original image ratio does not match the setting, the system will add a white**area to the edges of the image to fill in, making the image centered.
  • Trim according to the shortest edgeThis method also fixes the thumbnail size, but it cuts based on the shortest edge, preserving the central part of the image, which is very effective for highlighting the subject, but may cut off some edge information.

We can also set a "default thumbnail", when the article or product does not upload a separate thumbnail, the system will automatically use this default image for display to avoid blank or inconsistent display.If we adjust the thumbnail size or processing method during the operation, don't worry about the incompatibility of old images, AnQiCMS also provides the 'batch regenerate thumbnails' feature, allowing us to quickly update all thumbnails according to the new configuration.

In addition, AnQiCMS also considers the details of content publishing.For example, when we write documents, upload images, or reference images from external sources, the system provides the option to 'download remote images'.If you choose to download, all referenced external images will be downloaded to our server, which not only avoids the problem of broken external links, but also integrates these images into the optimization management system of AnQiCMS.On the front-end template level, AnQiCMS also supports imagesLazy Load (Lazy Load). By adding specific attributes to the image in the template, such aslazy="data-src"Images only start loading when they enter the user's visible area, which can significantly reduce the initial loading time for pages with a large number of images, further optimizing the user experience.

In summary, AnQiCMS provides a series of functions such as WebP format conversion, automatic image compression, flexible thumbnail generation and management, and remote image localization, thereby building an efficient and intelligent image optimization workflow for us.These settings can be easily configured in the "Content Settings" backend, without the need for complex coding knowledge, allowing the website images to be presented to users in the most optimized state while ensuring quality.


Frequently Asked Questions (FAQ)

  1. Ask: Why do my old images not change after enabling WebP conversion and image compression?Answer: AnQiCMS's WebP conversion and automatic compression feature is mainly aimed at new uploaded images after the feature is turned on.For existing old images on your website, the system will not process them automatically.If you want to apply these optimizations to old images as well, you can find features like 'Webp conversion tool' and 'batch regenerate thumbnails' in the 'Content Settings', and perform manual batch conversion and regeneration, or re-upload these images.

  2. Ask: Does AnQiCMS automatically generate thumbnails for all images in the content? I want different lists to display images of different sizes.Answer: The thumbnail processing provided by AnQiCMS in the "Content Settings" is for uniformly processing images uploaded to specified thumbnail fields (such as "Document Image") for articles, products, and other content.When you insert an image into the document content editor, if it is not specified separately, the system may use the first image in the content as a thumbnail.If you need to display images of different sizes in different front-end lists, you can use AnQiCMS template tags (such asitem.Logo/item.ThumborthumbFilter, combined with CSS styles to adapt to display. If finer control is needed, consider adding a custom image field in the content model, and upload images of different sizes to be called as needed in the template.

  3. Ask: Can I control the lazy loading of images in the front-end template? Does AnQiCMS have built-in lazy loading functionality?Answer: Yes, AnQiCMS supports lazy loading of images in the front-end template. In the document content field (for exampleContent), you can addlazy="data-src"attributes. For example:{% archiveDetail archiveContent with name="Content" lazy="data-src" %}{{archiveContent|safe}}. So, when generating HTML, the image tag will be automatically addeddata-srcA property, combined with a front-end JavaScript library (usually you need to import it yourself or it is integrated into the template), can enable lazy loading of images, reducing the initial loading time of the page.

Related articles

How to create and manage multiple sites in AnQiCMS to achieve independent content display?

AnQiCMS is an efficient enterprise-level content management system, and its multi-site management function is undoubtedly an important tool for many enterprises and operators to improve efficiency and segment the market.By creating and managing multiple independent sites under an AnQiCMS instance, we can flexibly provide customized content display and services for users of different brands, business lines, or regions.

2025-11-07

What template file types and organization modes does AnQiCMS support to control the display of the page?

## AnQiCMS template files and organization methods: The secret to flexible control of page display In the digital age, the visual presentation and content layout of a website are the core of attracting users and conveying information.An excellent content management system should also provide highly flexible page display control capabilities, in addition to powerful content management functions.AnQiCMS is designed based on such an idea, it not only makes content publishing efficient, but also gives users the powerful ability to customize the appearance of the website at will through its unique template file type and organizational mode.

2025-11-07

How to use AnQiCMS template tags to flexibly display different types of content?

AnQiCMS as an efficient and flexible content management system, its template tag system is the key to our website content operation and display.It provides a set of intuitive and powerful tools that allow us to present the content of the backend management in various styles according to different scenarios and needs, thereby greatly enhancing the flexibility and user experience of the website.

2025-11-07

How to customize the display layout of the website page in AnQiCMS?

AnQiCMS provides very flexible and powerful custom layout capabilities for website pages.Whether you want to quickly build a corporate website with a unique style or need to finely operate multi-site content, AnQiCMS can give you complete control over the 'skeleton' to 'flesh' of the website.### Core Concept: Comprehensive Control from Skeleton to Detail The customization ability of AnQiCMS is mainly reflected in the use of the Django template engine syntax, which is natural and smooth, easy to learn, even if you are not a professional backend developer

2025-11-07

How to set up independent display templates for AnQiCMS documents or categories?

In website operation, we often encounter such needs: some documents need a unique display method, the article list of a certain category needs a special layout, or a single page needs a unique design.AnQiCMS knows the importance of this personalized demand and provides flexible template settings to easily set independent display templates for documents, categories, and even single pages.This can not only help you better meet the diversity of content display, but also greatly enhance the user experience and the brand image of the website.Why do we need an independent display template?

2025-11-07

How does AnQiCMS optimize the URL structure through pseudo-static rules to improve search engine results display?

In today's digital marketing environment, a website's URL structure is not just an access address, but also a key element for user experience and search engine optimization (SEO).A clear and meaningful URL can enhance user trust and help search engines better understand the content of the page, thereby improving the display and ranking of the website in search results.AnQiCMS (AnQi Content Management System) fully understands this, and therefore its design in the field of pseudostatic rules provides powerful tools for website operators to optimize URL structure and stand out in search engines.

2025-11-07

How to ensure that AnQiCMS multilingual content switches and displays correctly on the front end?

Today, making a website support multilingual switching and display has become an important link for many enterprises to expand into the international market.AnQiCMS with its flexible architecture provides an efficient way to achieve this goal.This article will deeply explore how to configure and manage multilingual content in AnQiCMS, ensuring that they can be correctly switched and displayed on the front-end website, thus providing a high-quality browsing experience for users of different languages.

2025-11-07

How does AnQiCMS improve website page loading speed and display experience through static caching?

In the digital age, the loading speed of websites has become a key indicator of user experience and search engine rankings.A website that responds quickly can effectively enhance user satisfaction, reduce the bounce rate, and bring better exposure to the content.AnQiCMS is a content management system focused on high performance and efficiency, and the static caching mechanism plays a crucial role in improving website loading speed.

2025-11-07