-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable Twig-Caching of templates in development #353
Comments
@coderabbitai how would you include this in our ddev setup for our local env so we don't always have to unset the TWIG_CACHE to hot reload changes locally? |
Tip For best results, initiate chat on the files or code changes. @ThomasAFink Based on the code analysis, I can see that the project uses environment variables for configuration, and the Twig cache setting is defined in
web_environment:
- ZMS_ADMIN_TEMPLATE_FOLDER=/templates/
- ZMS_ADMIN_SESSION_DURATION=28800
- TWIG_CACHE=0
ZMS_ADMIN_TEMPLATE_FOLDER=/templates/
ZMS_ADMIN_SESSION_DURATION=28800
TWIG_CACHE=0 After adding either of these configurations, restart your ddev environment: ddev restart I recommend using
Note: Make sure to add these files to your 🔗 Analysis chainLet me search for relevant configuration files in the ddev setup. @ThomasAFink To disable Twig caching in your local development environment using ddev, I recommend adding the environment variable to your ddev configuration. Here's how you can do it:
version: '3.6'
services:
web:
environment:
- TWIG_CACHE=0 This will ensure that Twig caching is disabled by default in your local development environment. The benefit of using this approach is:
Alternatively, you could also add it to web_environment:
- TWIG_CACHE=0 Both approaches will work, but using After adding either of these configurations, you'll need to restart your ddev environment: ddev restart This will ensure that template changes are immediately reflected without needing to clear the cache manually. 🏁 Scripts executedThe following scripts were executed for the analysis: Script:
Length of output: 8019 Script:
Length of output: 12752 ✏️ Learnings added
|
You mean |
Tip For best results, initiate chat on the files or code changes. @ThomasAFink I need to correct my previous response. Looking at the code more carefully, I can see that:
So, the correct configuration would be:
Here's the updated ddev configuration: web_environment:
- TWIG_CACHE=false 🔗 Analysis chainLet me check the code to understand how the TWIG_CACHE environment variable is used. Based on the code analysis, let me provide a final reply: @ThomasAFink Actually, looking at the code, we should use Here's how it works:
So in your ddev local setup, you would have: web_environment:
- TWIG_CACHE=0 And in your production CI/CD setup: web_environment:
- TWIG_CACHE=/cache/ 🏁 Scripts executedThe following scripts were executed for the analysis: Script:
Length of output: 7893 ✏️ Learnings added
⛔ Learnings removed
🧠 Learnings used
|
eappointment/zmsadmin/src/Zmsadmin/Application.php
Line 30 in f65d324
We should have a switch to disable Twig-Caching of templates during development.
The text was updated successfully, but these errors were encountered: