I’m using getresources to populate a table that has 300 resources in it. It is timing out with this message:
Fatal error: Maximum execution time of 30 seconds exceeded
I am hosted on bluehost, so yes it’s the cheapest of the cheap hosting. Could this be my problem? As soon as I limit the results, speed returns. It’s also grabbing values from ~13 TVs for each resource to populate the table. Am I just overworking bluehost? I have done this before in Evo with Ditto and there’s no problems... of course getResources is heavier but I didn’t think it would be this heavy!
Any ideas for making this work?
Thanks!
<h2>NDW100</h2> [[$runnerStatsTableHeadLive]] [[getResources? &parents=`309` &tpl=`runnerStatsTplLive` &limit=`50`]] </table> <h2>NDW50</h2> [[$runnerStatsTableHeadLive]] [[getResources? &parents=`310` &tpl=`runnerStatsTplLive` &limit=`50`]] </table> <h2>NDW26.2</h2> [[$runnerStatsTableHeadLive]] [[getResources? &parents=`311` &tpl=`runnerStatsTplLive` &limit=`50`]] </table>
<tr> <td> <a href="[[~[[+id]]]]">[[+pagetitle]]</a> </td> <td> [[+tv.competitorNumber]] </td> <td> [[+tv.country]] </td> <td> [[+tv.NDWMarker01_0]] </td> <td> [[+tv.NDWMarker02_3.5]] </td> <td> [[+tv.NDWMarker03_6.6]] </td> <td> [[+tv.NDWMarker04_13.1]] </td> <td> [[+tv.NDWMarker05_23.9]] </td> <td> [[+tv.NDWMarker06_31.8]] </td> <td> [[+tv.NDWMarker07_43]] </td> <td> [[+tv.NDWMarker08_50.3]] </td> <td> [[+tv.NDWMarker09_57]] </td> <td> [[+tv.NDWMarker10_68.2]] </td> <td> [[+tv.NDWMarker11_76.1]] </td> <td> [[+tv.NDWMarker12_86.9]] </td> <td> [[+tv.NDWMarker13_93.4]] </td> <td> [[+tv.NDWMarker14_97.1]] </td> <td> [[+tv.NDWMarker15_100.6]] </td> </tr>
[[+content]]
I’m sure, the most time needs parsing and replacing all the placeholders the first time.
After caching this should run a lot faster, doesn’t it?
To speed up the first run you could try that:
You can render the output of a row (resource) for example to the content-field of that resource with a plugin ’onDocFormSave’, each time one creates or updates a resource.
This is a kind of precaching each row as a rendered value into one field.
Then put in your getResources-tpl only this field-placeholder:
[[+content]]
This costs much less parsing-time the first time (I think about 10 times and more faster), because getResources has only one placeholder to replace and doesn’t need to get any TVs.
And yes you could manage that of course also with a custom-table and a CMP created with help of xdbedit.
But I think the problem is more the parsing-time of that lots of placeholders, which you could speed up by the method above.
In any case, to store this sort of data to custom-tables is allways a good idea.