Closed samfrank closed 7 months ago
definitely wanted to add some caching alongside #173 but I do not have time to work on it right this second.
caching doesn't entirely depend on #173 though and I'm open to PR's. ideally it would be separate from Acorn's cache (e.g. not affected by acorn optimize
) and instead done with its own command acorn acf:cache
during deployment.
What did you do to narrow down the speed issues to ACF Builder, or specifically, building the field groups?
Even on a very slow droplet and a pretty thick site, I'm not seeing any huge performance hit when building the fields – but maybe I do not have as many fields.
Could you show me your results?
Simply change https://github.com/Log1x/acf-composer/blob/master/src/AcfComposer.php#L64 to
$timer = microtime(true);
$this->registerPath($this->app->path());
dd('Loaded in ' . round(microtime(true) - $timer, 3) . 's', $this->composers);
The only time I see a performance hit is when acf_add_local_field_group
is ran – and no matter what caching I do, nothing changes that. I don't think I have any control over that in particular. :(
Hey @Log1x
Thanks for replying to me to help diagnose the issue - I may of been jumping to conclusions about it being ACF Composer causing the issues so apologies for that.
After looking into the issue over sporadically over the past week I can see that this is a common result when using a lot of fields in a flexible content, the load time compounds and get worse with every layout addition.
I did run the monitor function above on a remote server (dev environment) and I did get concerning load time.
Can you invite me to a repo that can potentially reproduce this?
@Log1x Thank you, I have sent you an invite
I think a big issue is that I am maybe not using the package as intended.
We are using Flexible Content with the Classic editor instead of Blocks, which seems to be the main difference comparing your screenshot when building the field.
I am also using a lot of groups as well, which I have read is not great for performance
First of all, love the plugin. Great work!
We have been using Sage 10 and ACF Composer in most of our builds but we have started to notice that it is causing issues when we have a lot of fields and a lot of partials within a flexible sections.
We did have the same issue in ACF Builder, but we managed to cache the fields in a transient on remote servers so the build function did not have to run every time.
Has any one ever ran into this issue with ACF Composer and/ or have a potential solution?
This is what we did using ACF Builder but I am not sure how to implement this using ACF Composer