• I’m trying to speed my woocommerse store up.

    So far I’ve done well. When analyzing the server response time for the various elements, it seems that the admin-ajax.php is taking forever for the server to respond.

    After digging, it seems this file is being called 20 times or so per page load. Since all the other elements that are being called in have a fast server response time, it seems the issue is not a hardware one, but rather an issue in the design as to how woocommerce is dealing with this file.

    Do you have any suggestions as to what I can do to speed it up? This is the site.

    Thanks

    https://www.ads-software.com/plugins/woocommerce/

Viewing 5 replies - 31 through 35 (of 35 total)
  • WOW i finally found the solution and it works great here you go

    Allready added that script to functions but still 1.86 seconds just because of this…

    What script exactly you put? this one ? it did not change anything for me
    https://wordimpress.com/how-to-load-woocommerce-scripts-and-styles-only-in-shop/

    <?php
    /**
     * Optimize WooCommerce Scripts
     * Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
     */
    add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
    
    function child_manage_woocommerce_styles() {
    	//remove generator meta tag
    	remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
    
    	//first check that woo exists to prevent fatal errors
    	if ( function_exists( 'is_woocommerce' ) ) {
    		//dequeue scripts and styles
    		if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
    			wp_dequeue_style( 'woocommerce_frontend_styles' );
    			wp_dequeue_style( 'woocommerce_fancybox_styles' );
    			wp_dequeue_style( 'woocommerce_chosen_styles' );
    			wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
    			wp_dequeue_script( 'wc_price_slider' );
    			wp_dequeue_script( 'wc-single-product' );
    			wp_dequeue_script( 'wc-add-to-cart' );
    			wp_dequeue_script( 'wc-cart-fragments' );
    			wp_dequeue_script( 'wc-checkout' );
    			wp_dequeue_script( 'wc-add-to-cart-variation' );
    			wp_dequeue_script( 'wc-single-product' );
    			wp_dequeue_script( 'wc-cart' );
    			wp_dequeue_script( 'wc-chosen' );
    			wp_dequeue_script( 'woocommerce' );
    			wp_dequeue_script( 'prettyPhoto' );
    			wp_dequeue_script( 'prettyPhoto-init' );
    			wp_dequeue_script( 'jquery-blockui' );
    			wp_dequeue_script( 'jquery-placeholder' );
    			wp_dequeue_script( 'fancybox' );
    			wp_dequeue_script( 'jqueryui' );
    		}
    	}
    
    }

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    I am now closing this 8 month old topic as it references an older version of WordPress.

Viewing 5 replies - 31 through 35 (of 35 total)
  • The topic ‘admin-ajax.php slow server response time’ is closed to new replies.