Mcasey Posted February 27, 2013 Share Posted February 27, 2013 I have been developing a ticketing website through Prestashop for quite some time now. This site is fictional and serves a arbitrary purpose. (that is why products are free) Anyways... My site loads great.. Except for the "tickets" page in which all of my tickets are displayed. This is because the site has all products load at once (380ish) and then is sorted into groups (through java script) This is so a function I created for a "best seats" calculator can be used. I used google webmaster tools to determine what was putting such load on my database, and webmaster states that multiple queries are being made to the products images, making it load slower. I have optimal speed and APC installed. What should I do to improve this? Current load time is appx 6-9 seconds, which is less than optimal. Website: drhsmustangs.com Thanks Link to comment Share on other sites More sharing options...
Bill Dalton Posted February 28, 2013 Share Posted February 28, 2013 Can you not call these images from the same location? You are downloading the same image many times because of this. Looking at your source code, really cool how you are doing this. 293-297-home/seat-r11.jpg 295-299-home/seat-r11.jpg if(i < TestVar && 1 > 0){document.getElementById("text").innerHTML += '<img src="http://drhsmustangs.com/293-297-home/seat-r11.jpg" alt="" width="84" height="53" /><a href="http://drhsmustangs.com/tickets/293-seat-r11.html" target="_blank" title="" style="color: #fff;">Seat R11</a> $0.00 <a href="http://drhsmustangs.com/cart?qty=1&id_product=293&token=fa9832b826f39e154a3ee6006b2f6c1d&add=" rel="ajax_id_product_293" target="_blank" title="Add to cart" style="color: #fff;">Add to cart</a><br />';i++;} Link to comment Share on other sites More sharing options...
Mcasey Posted February 28, 2013 Author Share Posted February 28, 2013 (edited) Can you not call these images from the same location? You are downloading the same image many times because of this. Looking at your source code, really cool how you are doing this. 293-297-home/seat-r11.jpg 295-299-home/seat-r11.jpg Thanks for the reply, unfortunately I did think of this.. All of my images are located within one folder: /public_html/img/p/ I do not know how or why prestashop is calling these from different folders. Am I missing a key detail in this? Edited February 28, 2013 by Mcasey (see edit history) Link to comment Share on other sites More sharing options...
Mcasey Posted February 28, 2013 Author Share Posted February 28, 2013 SOS Link to comment Share on other sites More sharing options...
orotoi Posted March 7, 2013 Share Posted March 7, 2013 figured out anything useful mate? Link to comment Share on other sites More sharing options...
Mcasey Posted March 7, 2013 Author Share Posted March 7, 2013 Nope To subsidize for the immense load time I created a function that opens a div with a loading gif, so we are able to show the user that it takes a while to load, rather than them thinking that our site is broken. I don't think that this specific reason applies to most people, as they don't typically use custom pagenation. If you have slow load time I recommend using memcache, which many tutorials can be found on. Link to comment Share on other sites More sharing options...
orotoi Posted March 10, 2013 Share Posted March 10, 2013 i m going to try this week, making some images css sprites, and using memcache plus optimizing a little more all the existing images (products, photos etc) now i am on heavy days about 7-11sec and on good days around 3-5secs Link to comment Share on other sites More sharing options...
Arnel Posted March 10, 2013 Share Posted March 10, 2013 Hello Mcasey, Cool site - sorry to hear about the slow down issues. Whenever we critique a site for slowdown, we often use an performance evaluation site like gtmetrix.com. Put in the URL for the area that you're having problems with and you'll see a list of suggestions - some that you can implement and some you can't. Hopefully though, along with the changes you're already making, it will help knock down the load times. Regards, Arnel C. WebHostingHub.com Link to comment Share on other sites More sharing options...
Trip Posted March 10, 2013 Share Posted March 10, 2013 (edited) According to http://www.webpagete...details/cached/ you are loading about 400 pictures. I don't know what you did but the structure is questionable. When you preload all 400 pics and request the database for 400 results at once it surely gets slow. Enable define('_PS_DEBUG_PROFILING_', true); in config/defines.inc.php to see what results you get from the db and how long they take. From experience I know that the performance degredation from for example 25 to 50 products per page in a category is remarkable. You seem to collect the data (and pictures) for about 400 seats although only 12 are displayed. Usually Prestashop would perform excellent requesting only 12 results per page so why did you choose this way? Best regards, trip Edited March 10, 2013 by Trip (see edit history) Link to comment Share on other sites More sharing options...
Mcasey Posted March 10, 2013 Author Share Posted March 10, 2013 According to http://www.webpagete...details/cached/ you are loading about 400 pictures. I don't know what you did but the structure is questionable. When you preload all 400 pics and request the database for 400 results at once it surely gets slow. Enable define('_PS_DEBUG_PROFILING_', true); in config/defines.inc.php to see what results you get from the db and how long they take. From experience I know that the performance degredation from for example 25 to 50 products per page in a category is remarkable. You seem to collect the data (and pictures) for about 400 seats although only 12 are displayed. Usually Prestashop would perform excellent requesting only 12 results per page so why did you choose this way? Best regards, trip Thank you for the reply! The reason it is loading all 400 images is because I rewrote the pagination of prestashop so all products are loaded for a specific script (best seats) to run correctly. I have figured out a workaround to this problem, by running the script when you click the link to the products, so you are able to define how many seats you want first, making it so only a certain number of products are displayed at one time, and so the database is not queried for 400 pictures. I have not implemented this yet, but plan on doing so in the future. All the best! i m going to try this week, making some images css sprites, and using memcache plus optimizing a little more all the existing images (products, photos etc) now i am on heavy days about 7-11sec and on good days around 3-5secs Good luck! Let me know how it goes. Hello Mcasey, Cool site - sorry to hear about the slow down issues. Whenever we critique a site for slowdown, we often use an performance evaluation site like gtmetrix.com. Put in the URL for the area that you're having problems with and you'll see a list of suggestions - some that you can implement and some you can't. Hopefully though, along with the changes you're already making, it will help knock down the load times. Regards, Arnel C. WebHostingHub.com I'll check out your website in a bit! I usually use google's webmaster tools for this purpose, but it is always nice to have multiple sources! Thanks! Link to comment Share on other sites More sharing options...
Arnel Posted March 10, 2013 Share Posted March 10, 2013 Trip,- Thanks for the debug option! I'd never used it before! I know this is off topic, but are there any other really good debug tips you can share? Or can you point me to a good summary for them? Regards, Arnel C. Web Hosting Hub Link to comment Share on other sites More sharing options...
Mcasey Posted March 10, 2013 Author Share Posted March 10, 2013 To enable errors: Log into your hosting admin dashboard, control panel, SSH, or FTP client. Navigate to the PrestaShop 1.5 root folder. From there, navigate the path /config/config.inc.php Open up the config.inc.php file in the text editor. Find the line of code that reads "@ini_set('display_errors', 'off')" This is line 29 by default in PrestaShop 1.5 Change it to read "@ini_set('display_errors', 'on')" Save the config.inc.php file back to the path, overwriting the existing file if needed. this will display error messages on your page.. I use this for debugging often. Link to comment Share on other sites More sharing options...
Trip Posted March 11, 2013 Share Posted March 11, 2013 At arncus, I only have the RC here installed atm but I usually use define('_PS_MODE_DEV_', true); to see if there are mysql errors, missing tables and whatever and define('_PS_DEBUG_PROFILING_', true); to see if modules (hooks) are problemetic concerning processing time. Both can be found in config/defines.inc.php at least in my version. At Mcasey, yes there is defintily space for optimisation. First time byte is way to slow ... I would use the profiler to see which queries take so long to process. There are also missing files and stuff. Good luck, trip Link to comment Share on other sites More sharing options...
Recommended Posts