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 }}<br />
Uurprijs: {{ result.get("data").get("hourly-rate") }}<br />
<table>
<tr>
<td><b>Werkzaamheden</b></td>
<td><b>Omschrijving</b></td>
<td><b>Uren</b></td>
</tr>
{% for project in results.get("data") %}
{% set taskId = project.get("task-id") %}
<tr>
<td>{{ craft.harvestapi.getTask(taskId).get("data").get("name") }}</td>
<td>{{ project.notes }}</td>
<td>{{ project.hours }}</td>
</tr>
{% endfor %}
</table>
{% endcache %}
Thanks in advance!