Home › Forums › General Issues › Do you think this front-end posting app is too query-intensive? › Reply To: Do you think this front-end posting app is too query-intensive?
– #of queries for updating. I’m just giving you this for information. You actually have 6 fields including the repeater and 6 sub fields in the repeater. There are also this number of ACF field references. When inserting a new post this actually creates 2X this number of queries because WP does a query to see if the meta_key exists or has a value before it inserts the value. So what you actually have is (6*2)+(6*30*2)=372 postmeta queries.
I would definitely put an upper limit on the number of repeaters they can submit. Depending what these fields are 6 sub fields * 30 could time out on the submission. Text fields and other simple fields should not be an issue, but if you have 6 wysiwyg fields you might have an issue with only a single post being submitted depending on the amount of content being submitted.
– number of people hitting submit at the same time. I think that 1000 or more people all submitting a post at the same time would bring nearly any site on shared hosting down. I use VPS servers for some of our clients and I’d be worried about these going down. I’m sure we could beef these up to handle it if we needed to but then I’m not sure the clients would actually go for the additional costs. As far as shared hosting goes, depending on the data submitted, you’re going to see the server go down if this happens. You need to figure out what the likelihood of this happening is.
– post viewing, this should not be an issue. WP does a setup_postdata() when showing a post. This pulls all post meta data in a single query and puts it in the WP cache.
What you need to be careful of here is not the field content, but what you’re having ACF do with that field content. I will give you one example, image fields. When you return the image ID this will not create extra queries, however, returning an image array will create many additional queries to get all of the data associated with the attachments, some of which you may not need. If you have a lot of images you’re better of returning the ID and then only having WP get what you need instead of letting ACF do the work for you. The same can be said for post object and relationship type fields.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!