As an experienced website operations manager, I know the frustration and confusion you feel after tirelessly completing the AnQiCMS backend version upgrade, only to find that the front-end page remains unchanged.This is usually not a system failure, but rather due to the multi-layered caching mechanism behind the scenes, "faithfully" preserving the old version of the page content.To solve this problem, we need to delve into it like a detective, layer by layer, investigate and clear away these caches one by one.

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

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

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

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

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

Now, let's check and clear operations step by step according to these cache layers.

Step 1: Clear the internal cache of the AnQiCMS application.

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

Step two: Force refresh the browser cache

Even if the AnQiCMS backend cache has been cleared, your browser may still display the old page.The browser will cache the previously accessed page resources to improve loading speed.At this moment, you need to perform a 'hard refresh':

  • On Windows or Linux, it is usually pressedCtrl + F5orShift + Ctrl + R.
  • On macOS, it is usually pressedCmd + Shift + R.
  • Or, you can also manually open the browser developer tools (usuallyF12),Switch to the “Network” or “Application” tab, then select the “Clear Browser Cache” or “Disable Cache” option, and refresh the page.This 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 or other reverse proxy servers and these servers have cache functionality 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 reloadThe command to reload the configuration, which can also trigger cache refresh in some configurations.If you have deployed Nginx through Baota panel or 1Panel tools, you can directly find the options such as 'Clear Cache' or 'Reload Configuration' in the website settings of the panel.For Apache, if the caching module is configured, you may need to restart the Apache service to clear its cache.Please refer to your Apache configuration document or panel management interface for specific operations.This step ensures that the reverse proxy no longer provides old versions of web content.

Step 4: Clear CDN cache (if CDN service is used)

If you are using a CDN service (such as Alibaba Cloud CDN, Tencent Cloud CDN, Cloudflare, etc.), the cache of the CDN node is another place that needs attention.Log in to your CDN service provider's console, find the corresponding domain management page, and perform the "Clear Cache" or "Refresh Cache" operation.Generally, you can choose to clear all files, or only clear the cache for specific URLs.To ensure thoroughness, it is recommended to clear the cache of HTML, CSS, JS, and other resources on all pages.The clearing of CDN cache may take some time to take effect across all nodes globally, please be patient.

Step 5: Verify that the files on the server have been updated

In rare cases, the page may not be updated due to incorrect deployment or overwrite of the new version of the file. You need to log in to check the AnQiCMS deployment server.templatetemplate file under the directory (such asbash.html/index.htmletc.) as well aspublic/staticThe modification date and content of static resource files under the directory (such as CSS, JS files).Confirm that these files are indeed the content of the new version and not the remnants of the old one.If the file has not been updated, the problem may be with the upgrade script or deployment process, and the upgrade needs to be re-executed or the new file needs to be manually uploaded.

Step 6: Restart the AnQiCMS application

As a final troubleshooting step, sometimes a complete restart of the AnQiCMS application itself can clear deeper levels of memory cache or reload the configuration. If you are throughstart.shandstop.shRun the script AnQiCMS, you can execute it firststop.shStop the application first, then executestart.shLaunch the application. If it is deployed through Docker or Baota/1Panel's Go project management feature, you can directly restart the container or project in the management interface.This method will force the application to reinitialize all modules and caches.

Solve the problem of the front-end page not updating, we need to delve into it like detectives, layer by layer, and check it one by one.In most cases, by executing the "Update Cache" in AnQiCMS backend and hard refreshing the browser, the problem can be easily solved.If the issue still persists, then continue checking the reverse proxy and CDN cache based on your deployment environment will be crucial.


Frequently Asked Questions (FAQ)

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

Answer: AnQiCMS and other modern website systems are designed with multi-level caching mainly for maximum performance and user experience.The browser cache reduces the download amount each time a visit is made; The CDN cache pushes content closer to the user;Reverse proxy caching relieves the pressure on the backend server; while AnQiCMS's own application layer caching accelerates the page generation speed.Even though manual cache cleaning is required after version upgrades, this results in faster response times and high concurrency processing capabilities for the website in daily operation. 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 function of AnQiCMS or disable the cache of the reverse proxy?

Answer: Technically, you may be able to disable some 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 loading speed and performance of the website, increase the load on the server, and may even cause the website to crash under high traffic.This will seriously affect user experience and search engine rankings. It is better to understand the cache mechanism and perform precise cache cleaning operations when necessary, rather than completely disabling it.

Q3: After I upgraded, why are the images and CSS style files on the website still old, while the text content has been updated?

Answer: This situation is 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 expiration 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 update the static files.To solve this problem, you need to pay special attention to the steps of forcing the browser cache to refresh, clearing the CDN cache, and clearing the static file cache on the reverse proxy server (if your reverse proxy also caches static resources).Make sure all static resources are also reloaded forcibly to see the full update effect.