<p>Because your content is cached it "downloads" your website so it loads quick. 
This can be fixed by disabling cache to users that are logged in or maybe even certain users. This way you "bypass" the cache so you see the changes as soon as your page is loaded.</p>

<p><strong>unless #</strong></p>

<p>Prevents the {% cache %} tag from activating if a certain condition is met.</p>

<pre><code>{# Don't cache if someone is logged in #}
{% cache unless currentUser %}
</code></pre>

<p>You can find the cache options in the docs. </p>

<p>Source: <a href="https://craftcms.com/docs/templating/cache" rel="nofollow noreferrer">https://craftcms.com/docs/templating/cache</a></p>

CC BY-SA 3.0
2017-03-17T13:29:48.247Z
2017-03-17T13:29:48.247Z
Justin Dekkers
<p>Hello I am building a system in craft cms using the getharvest api. I have 'translated' the php api to support twig. The problem is the getharvest api is really slow (10+ seconds loading time)</p>

<p>I have solved this problem by using the <code>{% cache %}</code> tag
But now my problem is whenever content changes inside the <code>{% cache %}</code> you don't see the updated content but you see the same content as before.</p>

<p>Is there a way I can tell craft to update the cache whenever content changes inside the cache tag?</p>

<p>This is the code I use:</p>

<pre><code>        {% cache globally using key craft.request.getParam('id') %}
            {% set range = craft.harvestapi.setRange %}
            {% set results = craft.harvestapi.getProjectEntries(id, range) %}

            Budget: {{ result.get("data").budget }}&lt;br /&gt;
            Uurprijs: {{ result.get("data").get("hourly-rate") }}&lt;br /&gt;
            &lt;table&gt;
                &lt;tr&gt;
                    &lt;td&gt;&lt;b&gt;Werkzaamheden&lt;/b&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;b&gt;Omschrijving&lt;/b&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;b&gt;Uren&lt;/b&gt;&lt;/td&gt;
                &lt;/tr&gt;
                {% for project in results.get("data") %}
                    {% set taskId = project.get("task-id") %}

                    &lt;tr&gt;
                        &lt;td&gt;{{ craft.harvestapi.getTask(taskId).get("data").get("name") }}&lt;/td&gt;
                        &lt;td&gt;{{ project.notes }}&lt;/td&gt;
                        &lt;td&gt;{{ project.hours }}&lt;/td&gt;
                    &lt;/tr&gt;
                {% endfor %}
            &lt;/table&gt;
        {% endcache %}
</code></pre>

<p>Thanks in advance!</p>

<cache><plugin-elementapi><speed>
Update content inside cache tag
# Update content inside cache tag

(Asked by: username_0 on 2017-03-17)

Hello I am building a system in craft cms using the getharvest api. I have 'translated' the php api to support twig. The problem is the getharvest api is really slow (10+ seconds loading time)
I have solved this problem by using the {% cache %} tag
But now my problem is whenever content changes inside the {% cache %} you don't see the updated content but you see the same content as before.
Is there a way I can tell craft to update the cache whenever content changes inside the cache tag?
This is the code I use:
        {% cache globally using key craft.request.getParam('id') %}
            {% set range = craft.harvestapi.setRange %}
            {% set results = craft.harvestapi.getProjectEntries(id, range) %}

            Budget: {{ result.get("data").budget }}
            Uurprijs: {{ result.get("data").get("hourly-rate") }}
            
                
                    Werkzaamheden
                    Omschrijving
                    Uren
                
                {% for project in results.get("data") %}
                    {% set taskId = project.get("task-id") %}

                    
                        {{ craft.harvestapi.getTask(taskId).get("data").get("name") }}
                        {{ project.notes }}
                        {{ project.hours }}
                    
                {% endfor %}
            
        {% endcache %}

Thanks in advance!

**Tags:** cache, plugin-elementapi, speed


---

## 1 answers

### Answer by username_1 on 2017-03-17. Score: 1

Because your content is cached it "downloads" your website so it loads quick. 
This can be fixed by disabling cache to users that are logged in or maybe even certain users. This way you "bypass" the cache so you see the changes as soon as your page is loaded.
unless #
Prevents the {% cache %} tag from activating if a certain condition is met.
{# Don't cache if someone is logged in #}
{% cache unless currentUser %}

You can find the cache options in the docs. 
Source: https://craftcms.com/docs/templating/cache


---

