Managing Cache Creation
In production environments, it's crucial to manage how caching is handled to ensure optimal server performance. By default, the template engine is set to generate a new cache whenever templates are rendered. However, this behavior can be adjusted based on your requirements.
Disabling Cache Creation
To prevent the template engine from generating a new cache with each render, which can be resource-intensive in production environments, you can either remove or modify the `createCache` method call.
- Removing Cache Creation Call: Simply remove the line from your code where createCache(true) is called. This will stop the automatic cache generation process.
- Setting Cache Creation to False: Alternatively, you can explicitly set cache creation to false:
$templateEngine->createCache(false);
This approach explicitly informs the engine not to create new cache files, which can be beneficial in a stable production environment where template changes are infrequent.
- Installation - Installing Aurora Template
- Usage - Basic Usage of the PHP NLG Template Engine
- Storage-Setting Directories for Templates and Cache
- Templates - Setting Up Input Templates
- Variables - Setting Variables in the System
- Language Constants- Setting Language Constants
- Cache - Managing Cache Creation
- Router - Standalone Mode with Routing System
- Using the PHP Template Engine
- Blocks - Block Based template engine
- Using variables - How to use variables in templates
- Calculations - Isolation and Sharing Variables
- Include and Import - include vs. import in the Template Engine
- Import - Leveraging `import{}` for Standalone Applications with a Routing System
- Resources - Adding Resources to Templates
- Control Structures - `if`, `else if`, `else`
- Ternary Operator - How to approach to ternary operator
- Macros - Macros in Template Engines - Understanding the Concept
- Custom Macros - Creating Custom Macros in Template Engines
- Forms - Creating Forms in the Template Engine
- Custom forms - Customizing Forms in the Template Engine
- Custom PHP Forms - PHP Developer's Guide to Customizing Form Templates in the Template Engine
- Curly Brackets - Handling Curly Brackets in Text Content
- Error Handling - Error Handling in PHP Template Engine
- Tests