Home > shortcode, tips > Making Short Code Perform Faster

Making Short Code Perform Faster

March 18th, 2012

Forms that have many thousands of entries can be slow to return query results or may cause you PHP page to run out of memory. A quick addition to your short code can make the query run by the short code faster and require less memory. This addition is unbuffered=”true”.

Example: change [cfdb-table form="form1"] with
[cfdb-table form="form1" unbuffered="true"]

However: this cannot be used if you are nesting a short code inside another short code that is also doing a query. It doesn’t work if two queries are running at the same time. An example might be nesting a cfdb short code inside a [cfdb-html] short code.

Technical: This option makes use of the PHP mysql_unbuffered_query function instead of mysql_query.

Categories: shortcode, tips Tags:
  1. March 19th, 2012 at 01:02 | #1

    Hi Michael

    Many thanks for this tip. I have been meaning for ages to ask how to speed up my queries. Having said this, adding unbuffered=”true” into all my queries on this page of my site did not seem to speed it up appreciably.

    I am not nesting shortcodes/queries, but there are a lot of separate queries on that page and it is taking up to 30 seconds to load (I hit the 30 second limit a while back and the page stopped loading so I moved some of the queries off to separate pages, but now the page load time is back hovering around 26 or so seconds, so as more records are added I think it is only a matter of time before I have to do something more drastic).

    Any thoughts you have on how the page load time can be reduced will be greatly appreciated, as always :-)

    Gillian

Comments are closed.  Go To Support Forum