Why Editing Templates in External Editors Does Not Take Effect
Description of the template cache mechanism
AnQi CMS uses memory cache optimization strategy in the production environment:
- Preload at startup:Load the template files into memory all at once when the service starts
- Rendering Acceleration:Page requests directly read memory templates, avoiding repeated disk I/O operations
- Performance Advantages:Reduce server load, improve web page response speed to milliseconds
Development modification注意事项
When modifying template files through external editors (Baota panel/VSCode, etc.):
- ✖ Modification only affects disk files
- ✖ The memory cache template does not update automatically
- ✔ It needs to take effect in the following way:
- ▸ Restart the service (production environment)
- ▸ Switch to development environment (recommended for development stage)
Guide to environment configuration
Open the root directory underconfig.json, findenvConfigure and modify it.
Development mode (development)
Note that reading the template in real-time with each request will increase the server load
{
...
"server": {
"env": "development",
...
}
}
Applicable scenarios: template debugging period, website development stage Performance impact: increases server IO
Production Mode (production)
{
...
"server": {
"env": "production",
...
}
}
**Practice:
- Maintain development mode during the development period
- Complete full-scale testing before going online
- When deploying, switch to production mode
- Template update must follow the 'Modify→Restart' process