PDA

View Full Version : Could a lot of conditional overload the server Cpu or make pages loading slowly?


tintin74
05-30-2010, 03:13 PM
Hi everybody,

I need to insert some affiliate banner into the showthread template using for every thread a specific and different banner.

I'm running a large board with a lot of traffic (20.000 unique users a day).

I'm inserting a lot of conditional like this



<if condition="$threadinfo['threadid'] == 'XXXX'">banner 1

</if>


to get a different banner for every thread, but I don't know if this kind of method has a bad impact over the cpu load or making the page loading too slow.

Consider I need to insert a large number of conditional maybe 400-500.

If this method is not good , which is the best? Do you know any modification that could do this ?

Thank you ,

Tintin

Marco van Herwaarden
05-31-2010, 05:07 AM
Every condition that has to be evaluated does impact performance, even if it is only a little. But using many template conditionals like this will for sure have a negative impact.

Better to use a plugin and lookup the banner needed in an array.

tintin74
05-31-2010, 09:32 AM
Thank you Marco for your useful reply.
I'm not a programmer so, does anyone could help me to build a plugin like this? Does anyone knows if a similar modification exist ? I've search and installed some mods, but no one give the possibility to show a specific banner for a specific thread. :-(