Ingenious
Well-known member
I currently run a plugin in Xenforo which generates a random banner advert from a pool, and also some custom PHP widgets in Wordpress which do the same.
I wondered what people's views were on whether it is best to generate a random banner on the server using PHP, or, using Javascript to do the same thing in the browser. Does either way have advantages or disadvantages? Or is there no real difference?
One advantage I can see with Javascript is that it will allow me to cache the Wordpress files. If I cache them now would I lose the random functionality of the PHP banners (ie. it becomes static content). A cached PHP file but with Javascript would still run random banners as the script is being run in the browser.
Any thoughts? As Javascript is new to me I may of course be missing something obvious
I wondered what people's views were on whether it is best to generate a random banner on the server using PHP, or, using Javascript to do the same thing in the browser. Does either way have advantages or disadvantages? Or is there no real difference?
One advantage I can see with Javascript is that it will allow me to cache the Wordpress files. If I cache them now would I lose the random functionality of the PHP banners (ie. it becomes static content). A cached PHP file but with Javascript would still run random banners as the script is being run in the browser.
Any thoughts? As Javascript is new to me I may of course be missing something obvious