Template cache mechanism description
Auto CMS uses memory cache optimization strategies in the production environment:
- Preloading at startup:Load the template files all at once into memory when the service starts
- Render acceleration:Directly read memory template for page requests to avoid repeated disk I/O operations
- Performance advantages:Reduce server load, enhance web page response speed to the millisecond level
Development modification注意事项
When modifying template files through external editors (Baota panel/VSCode, etc.):
- ✖ Modifications only affect disk files
- ✖ Memory cache template will not update automatically
- ✔ It needs to take effect in the following way:
- ▸ Restart the service (for production environment)
- ▸ Switch to development environment (recommended for development stage)
Environment Configuration Guide
Open the root directory underconfig.json,foundenvConfigure, and make modifications.
Development mode (development)
Note that each request reading the template in real-time will increase the server load
{
...
"server": {
"env": "development",
...
}
}
Applicable scenarios: template debugging period, website development stage Performance impact: increased server I/O
生产模式(production)
{
...
"server": {
"env": "production",
...
}
}
**实践:
- 开发期保持development模式
- 上线前完成全量测试
- Deploy and switch to production mode
- Template update must follow the 'modify→restart' process