In AnQiCMS multi-site, implement unified static resource management and acceleration

For experienced website operation experts, managing static resources for a single site is already part of daily routine. However, when the business grows to the point where multiple sites need to be operated simultaneously, unified management and efficient acceleration of static resources become a core challenge.In this enterprise-level content management system AnQiCMS, which is designed for multi-site management, how to achieve this goal elegantly can not only greatly improve operational efficiency, but also bring the ultimate visit experience to users.

AnQiCMS is inherently capable of handling high concurrency and rapid response due to its high-performance architecture based on the Go language.One of its core highlights is the powerful multi-site management functionality, which allows us to easily manage multiple brands or business branches' websites within a single system.However, if each independent site maintains a set of static resources (images, CSS, JavaScript, fonts, etc.) independently, it not only causes storage redundancy but also leads to each fighting alone in performance optimization, resulting in uneven user access speed and high operating costs.Therefore, in the multi-site environment of AnQiCMS, it is particularly important to build a unified static resource management and acceleration system.

Understand the challenges of multi-site static resource management

Under the multi-site architecture, the main challenges faced by static resources include:

  • Resource dispersion and duplication:Multiple sites may use the same Logo, public style library, or JS framework.If each site stores these resources independently, it will cause a large amount of wasted storage space and version management chaos.
  • Slow loading speed:Static resources are not optimized or loaded from a server far from the user, which will directly affect the page loading speed, harm the user experience and SEO performance.
  • High maintenance cost:When it is necessary to update a public resource, it may be necessary to repeat the operation on all sites, which is inefficient and prone to errors.
  • Different cache strategies:Each site may adopt different caching strategies, resulting in low cache hit rates and unable to fully utilize performance advantages.

AnQiCMS has inherent advantages in unified management and acceleration.

The design concept of AnQiCMS has laid the groundwork to address these challenges.

Firstly,Multi-site management特性,强调“统一管理不同的内容站点,减少重复工作量,便于跨站点数据共享和资源整合”。Here, 'Resource Integration' provides the possibility of centralized management of static resources.High-performance architectureandStatic Cache and SEO OptimizationAbility, laying a solid foundation for resources to accelerate.Especially the "Resource Storage and Backup Management" feature, indicating that the system can configure external storage, which is a key step in achieving centralized storage.WebP image format supportandAutomatic compression of large images功能,更是直接作用于图片这一最常见的静态资源,从源头减少了文件体积。

统一静态资源管理与加速的核心思路

We can focus on the following three core ideas to implement unified static resource management and acceleration in AnQiCMS multi-site:

1. Centralized Storage: Moving towards a single data source

To achieve true "unification", the first step is to gather the static resources scattered across various sites into one place. The traditional approach is to set up a shared directory on the server, but a more modern cloud computing trend and scalable solution is to adoptCloud Object StorageServices (such as AWS S3, Aliyun OSS, Tencent Cloud COS, etc.).

  • AnQiCMS's Practice Path:AnQiCMS's “Resource Storage and Backup Management” function allows us to configure external storage. This means that we can no longer store all images, videos, and other media resources locally on each AnQiCMS site/public/staticThe content is directly uploaded and stored in the same cloud object storage bucket instead of in the directory.Each AnQiCMS multi-site instance (whether it is a new site added through reverse proxy on Baota panel or multiple containers deployed with Docker) will send the file to this unified object storage bucket when uploading images.So, regardless of which site uploads resources, they all belong to a centralized repository, avoiding redundancy and version conflicts.

2. Global Accelerated Distribution: The Power of CDN

After the static resources are stored centrally, the next step is