mattpooch Posted January 21, 2010 Share Posted January 21, 2010 I've got this page http://www.skipwallace.com/2010site/home.php and all the page extensions are .php to accommodate the random affiliate ads on the page. What can I do to make these pages load faster? Would it help if they were HTML? Oh, when I create 'index.php' would that work the same as 'index.html' or do I need a redirect? Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/ Share on other sites More sharing options...
JonnoTheDev Posted January 21, 2010 Share Posted January 21, 2010 What can I do to make these pages load faster? Would it help if they were HTML? If the ads are served from a 3rd party server then they will have to be requested on each page load. Pages serving lots of ads will generally be slow. I don't know why your would request ads using php. They are usually javascript. If so you can include the ad code to be loaded after the HTML is sent to the browser. The server where the ads are requested from maybe busy therefore slowing your page load also. Other things that can slow down a page are heavy database queries or poor code. Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/#findComment-999374 Share on other sites More sharing options...
mattpooch Posted January 21, 2010 Author Share Posted January 21, 2010 I used php to load the ads because I found a tutorial on it (http://www.phptoys.com/e107_plugins/content/content.php?content.49). Can you recommend a javascript tut? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/#findComment-999375 Share on other sites More sharing options...
JonnoTheDev Posted January 21, 2010 Share Posted January 21, 2010 There are no tutorials. The code should be provided by whoever your ads are generated by! Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/#findComment-999379 Share on other sites More sharing options...
mattpooch Posted January 21, 2010 Author Share Posted January 21, 2010 oh, the code is provided by the agency providing the ads. I meant, is there a tutorial to randomly display affiliate ads with javascript? Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/#findComment-999386 Share on other sites More sharing options...
JonnoTheDev Posted January 21, 2010 Share Posted January 21, 2010 no. i do not understand. affiliate ad code is fixed into your template. if you wanted to randomise between different ads then simply store the javascript code in different include files. i.e ad1.js ad2.js ad3.js To make it pick a random ad: <script language="javascript" src="ad<?php print rand(1,3); ?>.js"></script> Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/#findComment-999400 Share on other sites More sharing options...
mattpooch Posted January 21, 2010 Author Share Posted January 21, 2010 I think I'm with you. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/189310-php-pages-loading-slowwhat-to-do/#findComment-999491 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.