Hey @Log1x and thanks for updating acf-composer to v3. Massive improvement!
I just starting to testing it all out on my local and I noticed an memory issue when our Rankmath SEO plugin was generating our sitemap. If the sitemap for example has over 30 URL per page the memory gets exhausted.
I guess with the new caching $this->template gets saved on the first built and then carried over to the next time it needs built. If you have a page with a block that are used over 3 times, then it causes a problem. $this->template simply gets converted into JSON string everytime. Even if $this->template is a string it gets encoded again into JSON.
On a single page with 10+ blocks its fine, but 30 pages with 300 blocks the $this->template gets massive. Therefore memory getting exhausted.
Notice the third time "acf/button" is being used at the DEBUG line. $this->template is now [[0,"[]"]].
I have made a PR that should fix the problem of $this->template being converted recursively. If the $this->template is a string then return the string. Otherwise it should just contiune normally.
Hey @Log1x and thanks for updating acf-composer to v3. Massive improvement!
I just starting to testing it all out on my local and I noticed an memory issue when our Rankmath SEO plugin was generating our sitemap. If the sitemap for example has over 30 URL per page the memory gets exhausted.
I have traced it back to the this line: https://github.com/Log1x/acf-composer/blob/21f654dbaa6737878661f5b5f24c465cddbd7b67/src/Block.php#L464
I guess with the new caching
$this->template
gets saved on the first built and then carried over to the next time it needs built. If you have a page with a block that are used over 3 times, then it causes a problem.$this->template
simply gets converted into JSON string everytime. Even if$this->template
is a string it gets encoded again into JSON. On a single page with 10+ blocks its fine, but 30 pages with 300 blocks the$this->template
gets massive. Therefore memory getting exhausted.Here is a simple log trace here for one page:
Notice the third time "acf/button" is being used at the DEBUG line.
$this->template
is now[[0,"[]"]]
.I have made a PR that should fix the problem of
$this->template
being converted recursively. If the$this->template
is a string then return the string. Otherwise it should just contiune normally.