Closed aloco closed 3 years ago
Can you disable template caching and see if the changes are updated?
How do I disable opcache with nitro?
Unfortunately still no changes are updating
@jskrivanek the opcache extension is installed but not enabled by default. If you enable opcache using iniset
you can disable it in the same way.
@aloco I just tried and I am getting the same thing. I know Twig has its own template caching. I'm going to ask someone who knows more than I do (aka Brad) and chat with him about it this morning because I know we had this discussion in the past.
Thank you for looking into this! The reason behind using opcache in develoment is performance, currently the control panel is very slow without opcache. (it feels slower than with nitro 1) - enabling makes a huge difference, would be nice if we can use opcache also when working with twig so we don´t have to switch it on and off
@aloco can you answer the following questions so we can perform some investigation?
I found a way to make this work, but may require an upstream change in Craft. Discussing with the team to verify it will not break other changes as expected.
I made this change locally and enabling opcache I can see response times consistently below 300ms with fast updates to Twig templates! 🥳
Hi Jason,
I made some tests with one of our sites in development mode. Currently there is no eagerloading, cache tag etc. configured
1) What is the average response time (network tab in the browser) for the users page with opcache enabled?
2) What is the average response time (network tab in the browser) for the users page with opcache disabled?
3) How much RAM and CPU are assigned to Docker Desktop (Settings -> Resources)?
4) What paths to you have listed for sharing with mounts (Settings -> Resources -> File Sharing)?
/Users /Volumes /private /tmp /var/folders
5) Are you mounting a single site or an entire "dev" folder?
Single site, currently there are 5 sites running.
I found a way to make this work, but may require an upstream change in Craft. Discussing with the team to verify it will not break other changes as expected.
I made this change locally and enabling opcache I can see response times consistently below 300ms with fast updates to Twig templates! 🥳
Hi Jason,
can you point out where to make those changes so we can temporary get this boost as well till it finds it way into a release?
Thank you!
@aloco after a ton of debugging and investigation with @angrybrad, we have determine this is not a Craft upstream issue but an issue related to the opcache settings, specifically the validate timestamp options.
We are going to make a change to our docker images to set it as an argument and environment variable as well as add a nitro iniset
option to manage it for the next release.
For now, here is a quick way you can modify the setting (and any other PHP setting).
Let me know if this helps!
@jasonmccallister @angrybrad thank you guys for looking into this! Looking forward when we can set this via nitro iniset
, but for now this works for me!
Description
With opcache enabled, PHP file changes are recognized as expected and are invalidating the opcache. However, when making changes in twig files, it seems like those are not recognized. The HTML output stays the same. When disabling opcache, changes are always recognized
Steps to reproduce
Additional info