Jump to content

Pressed0024

Members
  • Posts

    220
  • Joined

  • Last visited

Posts posted by Pressed0024

  1. I saw this at Google page test:

     

    http://developers.google.com/speed/pagespeed/insights/

     

    Compacting HTML code, including any inline JavaScript and CSS contained in it, can save many bytes of data and speed up download and parse times.

     

     

    Compacting JavaScript code can save many bytes of data and speed up downloading, parsing, and execution time.

     

     

    When using Page Cache module is page load faster when you enable minify html/js or faster to disable them?

     

    When minify html is turned on, is Page Cache module caching the minified version?

     

    I already tested on my server but how does it fair for others?

  2. My site actually feels the same (when not on browser cache), in fact maybe faster (when on browser cache) than those 2 sites browsed from my location (Asia). I adopt 15 mins browser caching and loading is near instant when it hits browser cache. It feels the same as those 2 sites when cache is cleared. My server is in Phoenix, US. 

     

    My Pingdom performance loses at 2 sec load time. This is the full time taken to load all DOMs.

     

    I'm trying to speed up above-the-fold page render which is what matters. I'm looking at this module: http://www.prestashop.com/forums/topic/282343-free-module-move-java-script-to-footer/?do=findComment&comment=1477037

     

    Also hoping to see if anyone knows of any pre-loaded modules that is known to slow down the compilation.

     

    What is the optimum APC setting for a site that receives 800 average daily visits with average 4 pages per visit?

     

    Trying to put moving to a dedicated server as the last resort as that means I lose all those litespeed, fully-managed goodies that comes with shared hosting at good cost.

  3. @Pressed0024, I think most problems occur with $HOOK_HEADER. 

     

    $HOOK_HEADER should be within the header but it should load only css files. So the best way to achieve this is in your theme check all modules that are hooked to header and if they had used hookheader to load javascript files using tpl files then remove them from the just add them to them to the controller context. Like 

     

    $this->context->controller->addJS

     

    This way hookHeader will set the $js_files smarty param which we'll move to the bottom.

    Is there a "cleaner" way to do this? A module that can be enabled and disabled to do this task would be a lot easier to maintain in the long run :)

  4. Thank you! Yes 2.14 is current version. There is no feature in the queue but if you find one that can improve the module let me know!

     

    For the "Advanced cache management" events trigger, can you add Product comments as one of the trigger? When new comment is inserted or approved (backend), we had to purge the page cache manually. Having this trigger would be useful when we receive new product reviews.

  5. Thanks for the input.  

     

    " The file still needs to be compiled into a view-able product"

     

     

    So the next major time taken is the compilation of non-cached parts that Page Cache module can't do? What can be done or implemented to speed up this compilation or maybe further cache it?

     

    I also addressed the part about delaying js which takes up 1.2secs of the 3 secs first page render time which is huge savings: http://www.prestashop.com/forums/topic/292821-how-to-forcing-js-to-load-the-last/?view=findpost&p=1476673

  6. This is something intresting and I have been personally loading files at the bottom just after loading the page. This is how we can achieve this:

     

    Take a look at your header.tpl file of your theme.You will find something like this : 

    <script type="text/javascript">
        var baseDir = '{$content_dir|addslashes}';
        var baseUri = '{$base_uri|addslashes}';
        var static_token = '{$static_token|addslashes}';
        var token = '{$token|addslashes}';
        var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};
        var priceDisplayMethod = {$priceDisplay};
        var roundMode = {$roundMode};
    </script>
    {if isset($css_files)}
    	{foreach from=$css_files key=css_uri item=media}
    	<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
    	{/foreach}
    {/if}
    {if isset($js_files)}
    	{foreach from=$js_files item=js_uri}
    	<script type="text/javascript" src="{$js_uri}"></script>
    	{/foreach}
    {/if}
    {$HOOK_HEADER}
    

    You can just paste the above code in your footer.tpl file just before closing the <body> tag. 

     

    But it is not as simple as that.

    $HOOK_HEADER is used by lot of developers to load javascript, css files and also meta tags. If we paste HOOK_HEADER in the footer meta tags would be in the wrong place (meta tags are supposed to be withing <head> tag only) but if we leave just HOOK_HEADER then the javascript/css files that are loaded would be dependent on js files loaded above. So you'll have to check all the modules, make appropriate changes, test extensively and then deploy.

    Tested. It did delay js to load somewhere at the middle of timeline not at the end (which is fine since the page would already start to render). Problem is I get this striped down version of the website without css which is thrown to the left of the page for like 0.5sec before it starts to shift to the center and load normal. Every load turns out this way. Like you said, Hookheader embeds the CSS as well so BOTH css and js gets delayed.

     

    Is there another way to solely just delay all js including those Google API maps js, google font js, all the way to the back of the timeline? This would be especially helpful for those on shared hosting or not able to implement mod_pagespeed due to server mod conflicts.

  7. I'm focusing on the speed aspect now and doing further tuning. My goal is to make the store load feel "instant".

     

    Below are my debugs stats for the various core pages. I am using a full page cache module, APC (64mb 2 seg ttls set), MaxCDN (3 parallels), mysql query cache 512mb, shared server with 2 x 100% (2.64mhz) max allowed utilization.

     

    My page is taking 2-3 secs to render which is already fast enough. I'm looking to make this even faster. What is the next thing I should be looking at? (disable layered modules?, get a vps with more cores?, etc)

     

    I also wanted to understand a few aspect of the load time in debug:

    1. When APC caches, which part does it cache? The "config:" or "init:" part?
    2. While my Full Page Cache module is doing a wonderful job, I see that "Hook processing:" contributes to most of the ms. Can I assume that Hook processing makes up the "initContent:" time? What is FPC not caching?
    3. Does it make a difference if I Disable vs Uninstall a module? I tried disabling the "Analytics and Stats" modules but it doesn't make a diff.

    I'm looking to see what is the next impactful step to do. Hopefully some of you speed demons out there can share :)

     

     

    Product Pages

     

    Load time226ms
    Good boy! That's what I call a webserver!
    • config: 46ms
    • constructor: 0ms
    • init: 46ms
    • checkAccess: 0ms
    • setMedia: 2ms
    • postProcess: 0ms
    • initHeader: 0ms
    • initContent: 108ms
    • initFooter: 13ms
    • display: 10ms

     

    Hook processing107ms / 4.91 Mb

    • displayHeader: 36ms / 2.58 Mb
    • displayTop: 14ms / 0.48 Mb
    • displayFooter: 13ms / 0.53 Mb
    • moduleRoutes: 8ms / 0.27 Mb
    • actionProductOutOfStock: 6ms / 0.19 Mb
    • displayRightColumnProduct: 6ms / 0.19 Mb
    • displayProductTabContent: 5ms / 0.12 Mb
    • displayFooterProduct: 4ms / 0.16 Mb
    • displayProductTab: 4ms / 0.1 Mb
    • actionDispatcher: 4ms / 0.05 Mb
    • displayLeftColumn: 1ms / 0.05 Mb
    • displayProductButtons: 1ms / 0.06 Mb
    • displayLeftColumnProduct: 1ms / 0.06 Mb
    • displayRightColumn: 1ms / 0.07 Mb
    • maxHeader: 0ms / 0 Mb
    • actionFrontControllerSetMedia: 0ms / 0 Mb
    • actionModuleRegisterHookBefore: 0ms / 0 Mb
    • freeFblock: 0ms / 0 Mb
    • actionModuleRegisterHookAfter: 0ms / 0 Mb
    • DisplayOverrideTemplate: 0ms / 0 Mb
    • maxInfos2: 0ms / 0 Mb

     

    Memory peak usage12.9 Mb

    • config: 4.13 Mb (4.2 Mb)
    • constructor: 0 Mb (4.2 Mb)
    • init: 2.74 Mb (7 Mb)
    • checkAccess: 0 Mb (7 Mb)
    • setMedia: 0.08 Mb (7.1 Mb)
    • postProcess: 0 Mb (7.1 Mb)
    • initHeader: 0.01 Mb (7.1 Mb)
    • initContent: 4.83 Mb (11.9 Mb)
    • initFooter: 0.56 Mb (12.5 Mb)
    • display: 0.29 Mb (12.9 Mb)

    Total cache size (in Cache class)1.13 M

     

    DB type: DbPDO 
    SQL Queries97 queries 
    Time spent querying66ms
    Included files: 233
    Size of included files2.65 Mb

     

     

     

     

     

    Product Listing Page

     

    Load time736ms
    I hope it is a shared hosting

    • config: 157ms
    • constructor: 0ms
    • init: 53ms
    • checkAccess: 0ms
    • setMedia: 3ms
    • postProcess: 0ms
    • initHeader: 0ms
    • initContent: 423ms
    • initFooter: 13ms
    • display: 87ms

     

    Hook processing143ms / 11.32 Mb

    • displayHeader: 93ms / 8.76 Mb
    • displayTop: 19ms / 1.1 Mb
    • displayFooter: 13ms / 0.74 Mb
    • moduleRoutes: 7ms / 0.27 Mb
    • actionDispatcher: 4ms / 0.05 Mb
    • displayRightColumn: 3ms / 0.27 Mb
    • displayLeftColumn: 1ms / 0.05 Mb
    • productlHook: 1ms / 0.04 Mb
    • productlratingHook: 1ms / 0.03 Mb
    • maxHeader: 0ms / 0 Mb
    • freeFblock: 0ms / 0 Mb
    • actionModuleRegisterHookBefore: 0ms / 0 Mb
    • actionFrontControllerSetMedia: 0ms / 0 Mb
    • actionProductListOverride: 0ms / 0 Mb
    • actionModuleRegisterHookAfter: 0ms / 0 Mb
    • DisplayOverrideTemplate: 0ms / 0 Mb
    • maxInfos2: 0ms / 0 Mb

     

    Memory peak usage35.7 Mb

    • config: 11.64 Mb (11.7 Mb)
    • constructor: 0 Mb (11.7 Mb)
    • init: 5.03 Mb (16.7 Mb)
    • checkAccess: 0 Mb (16.7 Mb)
    • setMedia: 0.23 Mb (17 Mb)
    • postProcess: 0 Mb (17 Mb)
    • initHeader: 0.01 Mb (17 Mb)
    • initContent: 14.5 Mb (31.5 Mb)
    • initFooter: 0.75 Mb (32.3 Mb)
    • display: 3.3 Mb (35.7 Mb)

    Total cache size (in Cache class)1.35 Mb

     

    DB type: DbPDO 
    SQL Queries356 queries 
    Time spent querying218ms
    Included files: 241
    Size of included files2.48 Mb

     

     

     

     

     

     

     

    Home Page

    Load time214ms
    Good boy! That's what I call a webserver!
    • config: 84ms
    • constructor: 0ms
    • init: 29ms
    • checkAccess: 0ms
    • setMedia: 2ms
    • postProcess: 0ms
    • initHeader: 0ms
    • initContent: 84ms
    • initFooter: 11ms
    • display: 5ms
    •  

     

     

     

     

     

     

     

     

     

     

     

    Hook processing102ms / 11.03 Mb

    • displayHeader: 64ms / 8.75 Mb
    • displayFooter: 11ms / 0.74 Mb
    • displayTop: 10ms / 0.63 Mb
    • displayHome: 6ms / 0.28 Mb
    • moduleRoutes: 4ms / 0.25 Mb
    • actionDispatcher: 3ms / 0.05 Mb
    • displayRightColumn: 2ms / 0.27 Mb
    • displayLeftColumn: 1ms / 0.05 Mb
    • maxHeader: 0ms / 0 Mb
    • actionFrontControllerSetMedia: 0ms / 0 Mb
    • actionModuleRegisterHookBefore: 0ms / 0 Mb
    • freeFblock: 0ms / 0 Mb
    • DisplayOverrideTemplate: 0ms / 0 Mb
    • actionModuleRegisterHookAfter: 0ms / 0 Mb
    • maxSlideshow: 0ms / 0 Mb
    • maxInfos: 0ms / 0 Mb

     

    Memory peak usage27.4 Mb

    • config: 11.54 Mb (11.6 Mb)
    • constructor: 0 Mb (11.6 Mb)
    • init: 4.38 Mb (16 Mb)
    • checkAccess: 0 Mb (16 Mb)
    • setMedia: 0.23 Mb (16.2 Mb)
    • postProcess: 0 Mb (16.2 Mb)
    • initHeader: 0.01 Mb (16.2 Mb)
    • initContent: 10.01 Mb (26.3 Mb)
    • initFooter: 0.75 Mb (27 Mb)
    • display: 0.27 Mb (27.4 Mb)

    Total cache size (in Cache class)0.37 Mb

     

    DB type: DbPDO 
    SQL Queries39 queries 
    Time spent querying19ms
    Included files: 191
    Size of included files2.17 Mb
  8.  

    Hello All,

     

    To show order comments on order detail page in back office in 1.5.6.1 you all just need to do following steps and you will done with that i have implemented and tested well on prestashop 1.5.6.1.

     

    1) Open CustomerThread.php file from classes folder and add following function just after function getNextThread.

    public static function getCustomerMessagesByOrderId($id_order)
    {
      $sql = 'SELECT ct.*,cm.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname
       FROM '._DB_PREFIX_.'customer_thread ct
       LEFT JOIN '._DB_PREFIX_.'customer_message cm
        ON ct.id_customer_thread = cm.id_customer_thread
       LEFT JOIN `'._DB_PREFIX_.'customer` c
        ON ct.`id_customer` = c.`id_customer`
       LEFT JOIN '._DB_PREFIX_.'employee e
        ON cm.id_employee = e.id_employee
       WHERE id_order = '.(int)$id_order.' ORDER BY cm.id_customer_message DESC';
    
      return Db::getInstance()->executeS($sql);
    }
    

    2) Open AdminOrdersController.php file from controllers/admin folder and replace this line ( line #1368 )

    'messages' => Message::getMessagesByOrderId($order->id, true),
    

    with this line

    'messages' => CustomerThread::getCustomerMessagesByOrderId($order->id, true),
    

    Your solution works like a charm! I like how it also shows the corresponding Orders and Products at Customers>Customer Service>View.

     

    Are you a prestashop coder or merchant?

    • Like 1
  9. In Prestashop > 1.5, If you want to show all comments / Messages in Order page in BO then just do Following Two steps...

    By doing that you can see all comments in order page

     

    1) Add Following function to CustomerThread Class after getCustomerMessagesByOrderId Function..

     

    public static function getCustomerMessagesByOrderId($id_order)
    {
      $sql = 'SELECT ct.*,cm.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname
       FROM '._DB_PREFIX_.'customer_thread ct
       LEFT JOIN '._DB_PREFIX_.'customer_message cm
    	ON ct.id_customer_thread = cm.id_customer_thread
       LEFT JOIN `'._DB_PREFIX_.'customer` c
    	ON ct.`id_customer` = c.`id_customer`
       LEFT JOIN '._DB_PREFIX_.'employee e
    	ON cm.id_employee = e.id_employee
       WHERE id_order = '.(int)$id_order;
    
      return Db::getInstance()->executeS($sql);
    }
    
    2) And Change One line in File controllers/admin/AdminOrdersController.php

    From

    'messages' => Message::getMessagesByOrderId($order->id, true),
    
    to

    'messages' => CustomerThread::getCustomerMessagesByOrderId($order->id, true),
    
    This is working fine and i have already implemented this..

     

     

    Got it working in 1.4.9.1. It doesn't seem to work now in 1.5.6.1. Any idea?

  10. Thank you! Yes 2.14 is current version. There is no feature in the queue but if you find one that can improve the module let me know!

    Would suggest an auto crawler feature button or setting to slowly generate the HTML over a period of time to balance CPU load. This allows almost all cachable pages to be re-cached making no customer suffer non-cached page. This will also work help if the site has dynamic content as part of the html page so that a 1 day cache timeout can be set and the auto crawler feature will regenerate cache for all pages again.

  11. DHL and Fedex charges extra for remote areas that are out of their delivery area. We sometimes get customers in remote area address but charged them the normal rates which results in loss of revenues collected for shipping.

     

    http://www.dhl.co.uk/en/express/shipping/shipping_advice/surcharges.html

    http://www.dhl-usa.com/en/express/shipping/shipping_advice/surcharges.html#containerpar_expandablelist

    (rates may vary)

     

    A module that detects and apply additional charge depending on the carrier would be useful in helping cover the cost paid to the courier. A database of remote postal code should be maintained for each courier company. Module should be able to handling postal variances (eg. Ab54 4Pn and Ab544Pn without the spacing is the same)

     

    http://www.fedex.com/downloads/services/pdf/Zipcodes_OPA_ODA.pdf

    http://raslist.dhl.com/jsp/first.jsp

     

    The remote area database do not change often. No one has done this module before. This module should be able to last a long time.

     

    I hope this module comes out cheap and affordable so everyone can use. Sell on forums or your own website to be more flexible.

     

  12. Any 

     

     

    by default, if you've got ssl turned on, back office is also using ssl connection. By default, there is also no option to disable this feature only for back office.

     

    you can try to modify controller: classes/controllers/AdminController.php

     

    there is init() function with code:
     

    /* Server Params */
    $protocol_link = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://';
    $protocol_content = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http
    

    change it to:

    /* Server Params */
    $protocol_link =  'http://';
    $protocol_content = 'http://';

    then connect with your back office with simple http protocol, should work then without ssl (also ajax queries)

     

    Any idea if doing it at htaccess (after the prestashop default) would be easier and more presta version upgrade-proof?

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More