<p>is it possible you have Mutagen enabled in DDEV? Here's some DDEV docs that explain some lag inducing situations and how to avoid them:</p>
<p><a href="https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen" rel="nofollow noreferrer">https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen</a></p>
<p>Pasting a few that could explain this:</p>
<blockquote>
<p><strong>Avoid file changes when DDEV is stopped.</strong>
If you change files—checking out a different branch, removing a file—while DDEV is stopped, Mutagen has no way to know about it. When you start again, it will get the files that are stored and bring them back to the host. If you do change files while DDEV is stopped, run ddev mutagen reset before restarting the project so Mutagen only starts with awareness of the host’s file contents.</p>
</blockquote>
<blockquote>
<p><strong>Mutagen is asynchronous.</strong> A massive change in either filesystem can
result in lag as all changed files are handled. You can use ddev
mutagen monitor to get a better look at what’s happening.</p>
</blockquote>
<p>It might help to know what operating system you're on for further troubleshooting, although this may be the limits of my DDEV knowledge.</p>

CC BY-SA 4.0
2023-03-08T11:06:25.477Z
You totally nailed it. I turned Mutagen off and the changes propagated instantly. The only issue now is that my performance time has plummeted, going from 57ms to 3,300 ms. I think it's due to not setting the "upload_dir to where your user-generated files are stored" and this due to the fact that there are multiple dirs - which would be resolved by this product suggestion: https://github.com/ddev/ddev/issues/4190. Thank you cherrykoda!
darkbasic
CC BY-SA 4.0
2023-03-08T00:55:18.530Z
2023-03-08T00:55:18.530Z
cherrykoda
<p>If I make changes to one of my twig templates, it takes over twenty seconds for Craft to reflect the updates on the local site. I'm running Craft locally in DDEV.</p>
<p>I tried the debug toolbar but am getting great performance there:
&quot;Performance Profiling
Total processing time: 57 ms; Peak memory: 5.075 MB&quot;</p>
<p><strong>Steps:</strong></p>
<p>Update _entry.twig (make a small update to {{ entry.title }}, changing it to {{ entry.postDate | date('d M Y') }})</p>
<pre><code>{% extends &quot;_layout.twig&quot; %}

{% block content %}
 &lt;h1 class=&quot;text-4xl text-black font-display my-4&quot;&gt;{{entry.title }}&lt;/h1&gt;

 &lt;time class=&quot;text-sm block pb-4&quot; datetime=&quot;{{ entry.postDate | date('Y-m-d') }}&quot;&gt;{{ 
entry.postDate | date('d M Y') }}&lt;/time&gt;
{% endblock %}
</code></pre>
<p>Changed to:</p>
<pre><code>{% extends &quot;_layout.twig&quot; %}

{% block content %}
 &lt;h1 class=&quot;text-4xl text-black font-display my-4&quot;&gt;{{ entry.postDate | date('Y-m-d') }}&lt;/h1&gt;

 &lt;time class=&quot;text-sm block pb-4&quot; datetime=&quot;{{ entry.postDate | date('Y-m-d') }}&quot;&gt;{{ 
entry.postDate | date('d M Y') }}&lt;/time&gt;
{% endblock %}
</code></pre>
<p>I have to click refresh on the Craft site for 20s before I see the change actually propagate. Is there a way to speed this up so the change propagates in less than 1s?</p>

<templating><performance><ddev>
Changes to twig template take over 20s to propagate
# Changes to twig template take over 20s to propagate

(Asked by: username_0 on 2023-03-07)

If I make changes to one of my twig templates, it takes over twenty seconds for Craft to reflect the updates on the local site. I'm running Craft locally in DDEV.
I tried the debug toolbar but am getting great performance there:
"Performance Profiling
Total processing time: 57 ms; Peak memory: 5.075 MB"
Steps:
Update _entry.twig (make a small update to {{ entry.title }}, changing it to {{ entry.postDate | date('d M Y') }})
{% extends "_layout.twig" %}

{% block content %}
 {{entry.title }}

 {{ 
entry.postDate | date('d M Y') }}
{% endblock %}

Changed to:
{% extends "_layout.twig" %}

{% block content %}
 {{ entry.postDate | date('Y-m-d') }}

 {{ 
entry.postDate | date('d M Y') }}
{% endblock %}

I have to click refresh on the Craft site for 20s before I see the change actually propagate. Is there a way to speed this up so the change propagates in less than 1s?

**Tags:** templating, performance, ddev


---

## 1 answers

### Answer by username_1 on 2023-03-08. Score: 2 | Accepted answer

is it possible you have Mutagen enabled in DDEV? Here's some DDEV docs that explain some lag inducing situations and how to avoid them:

<https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen>

Pasting a few that could explain this:

> **Avoid file changes when DDEV is stopped.**
> If you change files—checking out a different branch, removing a file—while DDEV is stopped, Mutagen has no way to know about it. When you start again, it will get the files that are stored and bring them back to the host. If you do change files while DDEV is stopped, run ddev mutagen reset before restarting the project so Mutagen only starts with awareness of the host’s file contents.

> **Mutagen is asynchronous.** A massive change in either filesystem can
> result in lag as all changed files are handled. You can use ddev
> mutagen monitor to get a better look at what’s happening.

It might help to know what operating system you're on for further troubleshooting, although this may be the limits of my DDEV knowledge.

> **Comments:**
> **username_0**: You totally nailed it. I turned Mutagen off and the changes propagated instantly. The only issue now is that my performance time has plummeted, going from 57ms to 3,300 ms. I think it's due to not setting the "upload_dir to where your user-generated files are stored" and this due to the fact that there are multiple dirs - which would be resolved by this product suggestion: https://github.com/ddev/ddev/issues/4190. Thank you username_1!  

---

