Before we delve into the details of how to solve it, we first need to understand several main caching layers of content delivery on the website:

Your browser will intelligently store the static resources (such as CSS, JavaScript, images) and some HTML content of the website to load it faster when you visit again.This is the most common cache layer on the user side.

If you use a CDN service to accelerate website access, then the CDN node will also cache your website content on the server closest to the user.This helps improve access speed, but it also means you need to inform the CDN to clear old content.

Many AnQiCMS users configure Nginx or Apache as a reverse proxy to forward external requests to the AnQiCMS application.This layer of service will also usually open its own cache mechanism to reduce the pressure on the backend server.

AnQiCMS itself also has an efficient static cache mechanism, used to accelerate page rendering and data query.For example, it may cache the results of template compilation, database queries, etc., to ensure that the system runs at high speed.

Now, let's gradually check and clear operations based on these cache layers.

Step 1: Clear the internal cache of AnQiCMS application

This is the most direct and the first step that should be tried.AnQiCMS backend usually provides a clear 'update cache' or 'clear cache' function.You can navigate to the backend to find the 'Update Cache' option (usually located near 'System Update' or 'System Settings'), and click to execute.This operation will clear the template cache and data cache generated by the AnQiCMS application layer, forcing the system to recompile templates and load the latest data.If the problem is only due to application layer caching, the page will usually update immediately after performing this operation.

第二步:Force refresh browser cache

Even if the AnQiCMS background cache has been cleared, your browser may still display the old page.The browser caches previously accessed page resources to improve loading speed.

  • On Windows or Linux, it is usually by pressingCtrl + F5orShift + Ctrl + R.
  • On macOS, it is usually by pressingCmd + Shift + R.
  • or, you can also manually open the browser developer tools (usuallyF12Switch to the "Network" or "ApplicationThis ensures that your browser re-downloads all resources from the server.

Step 3: Clear the reverse proxy server cache

If your AnQiCMS website is configured with Nginx or Apache and other reverse proxy servers, and these servers have cache functions enabled, then you also need to clear their respective caches. For Nginx, you may need to log in to the server, find the Nginx cache directory, and manually delete the files in it, or executesudo nginx -s reloadUse commands to reload the configuration, which can also trigger cache refresh under some configurations.If you have deployed Nginx via panel tools such as Baota Panel or 1Panel, you can directly find the 'Clear Cache' or 'Reload Configuration' options in the panel's website settings.For Apache, if the cache module is configured, you may need to restart the Apache service to clear its cache.Please refer to your Apache configuration document or control panel interface for specific operations.This step ensures that the reverse proxy no longer provides web content from old versions.

Fourth step: Clear CDN cache (if CDN service is used)

If you are using CDN services (such as Alibaba Cloud CDN, Tencent Cloud CDN, Cloudflare, etc.), the cache of CDN nodes is another place that needs attention.Log in to your CDN service provider's console, navigate to the corresponding domain management page, and perform the 'Clear Cache' or 'Refresh Cache' operation. 通常,您可以选择清除所有文件,或仅清除特定URL的缓存。To ensure thoroughness, it is recommended to clear all HTML, CSS, JS, and other resource caches on all pages.The clearing of CDN cache may take some time to take effect on all nodes globally, please be patient.

Fifth step: Verify if the files on the server have been updated

In rare cases, the page not being updated may also be related to the incorrect deployment or overwriting of the new version of the file. You need to log in to the server where AnQiCMS is deployed to checktemplateThe template files under the directory (such asbash.html/index.htmletc.) as well aspublic/staticThe modification date and content of static resource files (such as CSS, JS files) under the directory.Confirm that these files are indeed the content of the new version, not the old residue.If the file has not been updated, the problem may be with the upgrade script or deployment process, and you need to re-run the upgrade or manually upload a new file.

Step 6: Restart the AnQiCMS application

As a final troubleshooting measure, sometimes a complete restart of the AnQiCMS application itself can clear deeper memory caches or reload the configuration. If you are usingstart.shandstop.shScript runs AnQiCMS, first executestop.shStop the application and then executestart.shStart the application.If the project is deployed through the Docker or Baota/1Panel Go project management function, container or project restart operations can be performed directly on the management interface.This method will force the application to reinitialize all modules and caches.

Solve the problem that the front-end page does not update, we need to delve into it like a detective, layer by layer, and investigate one by one.In most cases, by executing the 'Update Cache' in AnQiCMS backend and hard refreshing the browser, the problem can be resolved.If the issue still exists, continue checking the reverse proxy and CDN cache based on your deployment environment will be crucial.


Common Questions and Answers (FAQ)

Q1: Why does the AnQiCMS website need so many layers of caching, will this make content updates very麻烦?

答: AnQiCMS and other modern website systems are designed with multi-layer caching mainly for optimal performance and user experience.The browser cache reduces the amount of data downloaded each time a visit is made; CDN cache pushes content closer to the user; reverse proxy cache relieves the pressure on the backend server; and AnQiCMS's own application layer cache accelerates the page generation speed.Although manual cache clearing is required after version upgrades, this brings faster response and high concurrency processing capabilities in the daily operation of the website. For small and medium-sized enterprises and self-media operators, the performance improvement brings obvious advantages in user retention and SEO.

Q2: Can I disable the cache feature of AnQiCMS? Or disable the reverse proxy cache?

答: In technical terms, you may be able to disable certain cache layers (such as, modifying the Nginx configuration or certain hidden settings of AnQiCMS).However, as a website operator, I strongly advise against doing this, especially in a production environment.Disabling cache will significantly reduce the website's loading speed and performance, increase the server's load, and may even cause the website to crash under high traffic.This will seriously affect user experience and search engine ranking.It is better to understand the cache mechanism and perform precise cache cleaning operations when necessary, rather than disabling it completely.

Q3: After the upgrade, I found that the images and CSS style files on the website are still old, but the text content has been updated. What is the reason for this?

答: This situation is very common, usually because the cache of static resources is more 'stubborn' than that of dynamic content (such as text).Browsers and CDNs have longer cache duration settings for images, CSS, and JS files because they usually do not change frequently.When you only clear the AnQiCMS internal cache, it will only update the database content and template compilation, but will not force the update of static files.To solve this problem, you need to pay close attention to the following steps: force refreshing the browser cache, clearing the CDN cache, and clearing the static file cache on the reverse proxy server (if your reverse proxy also caches static resources).Ensure that all static resources are also reloaded to see the full update effect.