Flexible content performance limits
- This topic has 6 replies, 2 voices, and was last updated 1 year, 4 months ago by
Li Bud.
-
AuthorPosts
-
December 7, 2023 at 4:13 PM #44032
Li Bud
ParticipantHi,
Following the guide here https://metabox.io/create-acf-flexible-content-field-with-meta-box/, we're creating a flexible content builder. The entire field group will have about 35 section groups, each of them has around 5-10 custom fields, some of them have additional clone-able groups to create bullet lists and similar. The site is running on the latest WP and Metabox versions. PHP max_input_vars are set to 20000, memory limit's at 1024mb. PHP 8.0.2, nginx server and mysql 8.0.16. I've already looked around online quite extensively for answers relating to the below concerns - I haven't found any answers that would cover them fully.
The following concerns have come up:
- Risk management: has the performance of creating such large flexible content groups been ever stress-tested? Have any page load speed issues been observed on the front-end?
- The Metabox builder on the back-end slows down considerably after about 10 groups are added e.g. expanding/collapsing fields has a considerable delay. Is there anyway to improve the performance?
- If there are more than a couple WYSIWYG fields used inside the flexible content section groups, the flexible content "builder" in the post/page backend becomes quite laggy after 3-4 groups with wysiwyg fields have been added.
- Search speed: this thread addresses an interesting question regarding large amounts of custom fields and search. https://support.metabox.io/topic/about-speed-performance/ . The recommendation there is to use a custom table to optimize sql queries. Would the same advice be applicable when constructing flexible content builders?Thanks for your help and insight.
December 7, 2023 at 10:31 PM #44038Peter
ModeratorHello,
Let me answer your questions.
1. There shouldn't be a page loading speed when outputting the value in the front end, very slightly. The group field value is saved in the database as a serialized and you can get all subfield values with one function. Following the documentation https://docs.metabox.io/extensions/meta-box-group/
2. The builder is created with JavaScript code, so it will slow down if you have more fields. I will inform the development team to improve the builder in future updates.
3. Please share a screen record of the issue on your end with the WYSIWYG field.
4. Use the custom table to save field value when you need to query post by field value. If you only get field value by post ID, no need to use that.
December 12, 2023 at 7:08 PM #44062Li Bud
ParticipantHi, sorry for the delay. Here's a screen recording of the issues I've found: https://filetransfer.io/data-package/KDq0MmfC#link
Thanks for your help!
December 13, 2023 at 10:08 AM #44073Peter
ModeratorHello,
Please export your field group to a JSON file and share it here. I will test it on my demo site and escalate the issue to the development team.
Thank you.
December 13, 2023 at 8:40 PM #44080Li Bud
ParticipantHi,
The two field group JSON's can be found here: https://filetransfer.io/data-package/WLX70Xld#link
One of them has lots of WYSIWYG fields, the other - lots of groups.
On the same topic, related to my first question about performance:
I've done more testing exploring alternatives to my initial idea about using a flexible content setup. As an alternative I've been assessing the possibility of normalizing our database structure using MB Custom Tables.
As the docs suggest all group data is serialized using the PHP serialize function. Is there any feasible way of changing the method of serialization to JSON encode?
To add context: my main concern is that using PHP serialize locks us into a programming language and would obstruct the effort to normalize the database structure, making the data reusable in other cms's/front ends/apps. IMOuUsing a more standardized, language agnostic serialization method for arrays would likely future-proof the chosen architecture. Also changing text using DB search&replace in in JSON arrays shouldn't break the serialized data structures as opposed to doing that for PHP serialized data, which would still make the JSON arrays more reusable even in a flexible content arrangement.
I know that PHP serialize is WP's legacy, but maybe there's a feasible way nonetheless?
Thanks for any pointers.
December 15, 2023 at 11:13 AM #44098Peter
ModeratorHello,
I see the slowdown issue of the field group when having more custom fields. I will forward them to the development team to check them and improve the performance.
Regarding the group data, it works as the standard serialized data of WordPress and is a core feature. There isn't an option to change the data format to JSON. If you want to search and replace the value in the DB, you can use the plugin https://wordpress.org/plugins/better-search-replace/ which supports serialization.December 19, 2023 at 1:45 AM #44135Li Bud
ParticipantAlright, thanks for your help.
-
AuthorPosts
- You must be logged in to reply to this topic.