How to troubleshoot when the front page does not update after the AnQiCMS program upgrade?
When you eagerly upgraded the AnQiCMS program, thinking that new features and optimizations would immediately appear on your website, only to find that the front-end page remains unchanged, still stuck in the old version, this feeling is indeed a bit crazy.Don't worry, this is usually not a big problem, most likely due to caching or program loading mechanisms.Today let's check it out in detail to see how to make your website's front end look fresh.
Why does the page not update?
AnQiCMS as a high-performance application developed based on the Go language, in order to provide efficient and stable services, it runs the program files in memory after loading them.Therefore, when we complete the upgrade operation, if it is only the files that are replaced without notifying the program to reload or restart, it will still use the old program code to render the page.In addition, to improve access speed and user experience, browsers, the AnQiCMS system itself, and the server's reverse proxy (such as Nginx or Apache) will each have their own caching mechanisms. These old caches may also hinder you from seeing the latest page content.
Understood, we can then target the investigation.
Investigation and solution steps:
通常,我们会从最简单、最常见的步骤开始,逐步深入。
First step: Clear the browser cache (the simplest and fastest way)
Most of the time, the problem lies with your browser's local cache. The browser stores the old version of the website files to load the page faster next time.
- On Windows or Linux, you can try pressing
Ctrl + F5key.} - On macOS, you can try pressing
Cmd + Shift + Rkey.} - If the shortcut key is not working or you want to clean up completely, you can manually enter the browser settings, find the 'Clear Browsing Data' or 'History' option, and select to clear cached images and files.
Step 2: Clear AnQiCMS internal cache
The AnQiCMS system also has a caching mechanism to accelerate page generation. After an upgrade, these caches need to be cleared so that the system can read the new configuration and templates again.
- Log in to the AnQiCMS backend.
- Find and click on "System Update" (or "Update Cache", the name may vary slightly depending on the version).
- There is usually a 'Update Cache' button or link on the page, click it to clear the internal cache of the system.
Step 3: Restart the AnQiCMS program (core step)
This is a key step to solve the problem of the front-end page not being updated. Because AnQiCMS is an independent executable file compiled from Go language, it needs to be restarted to load new code and configuration.
If you use Docker deployment (for example, through 1Panel or aaPanel):
- Log in to your panel (1Panel or aaPanel).
- Find the 'Container' or 'Docker' management interface, find the container instance running AnQiCMS.
- Select the container, click the 'Restart' button. Typically, Docker will stop the old container and restart a container with a new image or file.
If you are using the Baota panel's Go project or general project deployment:
- Log in to the Baota panel.
- Find 'Website' -> 'Go project' or 'Other projects' in the left menu.
- Find your AnQiCMS project and click the corresponding "restart" button.
If you are manually deploying through the command line (for example using)
start.shandstop.shscript):- Connect to your server via SSH.
- Enter the directory where the AnQiCMS program is located (for example
/www/wwwroot/anqicms.com) - Firstly, execute the stop script:
./stop.sh. Wait for the program to stop completely. - Then execute the startup script:
./start.sh. - Ensure the program has started successfully and there are no error messages.
If you are testing locally on Windows:
- Open the Task Manager (press
Ctrl + Shift + Esc) - Find it on the “Process” or “Details” tab.
anqicms.exeProcess. - Select it and then click “End Task”.
- Double-click again.
anqicms.exeFile to start the program.
- Open the Task Manager (press
Step 4: Clear the server reverse proxy cache or CDN cache (if applicable)
If your website's front-end uses Nginx, Apache as a reverse proxy, and they are configured with caching, or you use a CDN service, then these places may also cache old page content.
- Nginx/Apache Cache:It is usually necessary to manually clear the Nginx or Apache cache directory, or to restart the Nginx/Apache service.The specific operation depends on your server configuration. If you are not familiar with it, it is recommended to consult the server administrator or refer to the relevant documentation.
- CDN Cache:If the website uses a CDN (Content Delivery Network), you need to log in to the CDN service provider's backend, find the corresponding website acceleration configuration, and perform the "refresh cache" or "preheat cache" operation.
The fifth step: check the integrity and permissions of the file (less common but should be considered)
It is not common, but during the upgrade process, it may occur that files are not fully replaced, files are damaged, or file permissions are incorrect.
- Resubmit:If all the above steps are ineffective, you can try uploading the latest AnQiCMS installation package to the server again and extracting it overwriting (make sure to back up important data).
- Check file permissions:Ensure that the AnQiCMS program files and their dependent directories (such as
template/publicdirectories) have permissions that allow the AnQiCMS running user to read and write. Typically set towwwUsers have read and write permissions, other users only have read permissions.
Summary and Prevention
In most cases, by clearing the browser cache, AnQiCMS internal cache, and restarting the AnQiCMS program, the issue of the front page not being updated can be resolved.After updating the program, it is good to develop the habit of 'clearing the cache + restarting the program', which can effectively avoid such troubles.
Frequently Asked Questions (FAQ)
Q1: Why does the background management interface show the new version, but the front page is still old?A1: This is likely because the AnQiCMS program has already loaded the new backend code, but the template files, static resources, or data cache on the front-end page are still stuck at the old version.Make sure to follow the steps above, first clear the browser cache, the "Update Cache" feature of AnQiCMS backend, and then most importantly, restart the AnQiCMS program completely.If your website still uses Nginx/Apache reverse proxy or CDN, also remember to clear their cache.
Q2: I just modified a template file, but the front-end page didn't take effect. Should I also perform these steps?A2: Yes, it is also a cache problem that the front-end page does not update after modifying the template file.AnQiCMS when rendering templates also uses cache to improve efficiency.Generally, you just need to perform the cleanup of the browser cache and the 'Update Cache' function in the AnQiCMS backend.If it is still invalid, consider restarting the AnQiCMS program.
Q3: After the upgrade, the website cannot be accessed directly, or it prompts a 500 error. Is this the same problem as the front-end not being updated?A3: