I'm getting a fatal error when wrapping a loop with {% cache %}{% endcache %}
tags. The full error is:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /craft/app/helpers/StringHelper.php on line 473
Here's a small code sample of what I'm doing
{!--
`craft.locationAPI.fetchAllLocations` grabs ~200 entries with related data via custom SQL queries.
Doing this because craft.entries was throwing memory limit errors.
--}
{% cache %}
{% for entry in craft.locationAPI.fetchAllLocations() %}
...
{% endfor %}
{% endcache %}
I'm guessing this is because the amount of data getting returned (~13300 lines in "View Source") is too large for the encodeMb4
function in StringHelper.php.
Anything I can do to avoid this?