Support » Plugin: WooCommerce » ?wc-ajax=get_refreshed_fragments – slow loading

  • Hi all

    Been trying to get to the bottom of this for a couple of days now and can’t seem to make any progress.

    When I run pingdom I get the ‘?wc-ajax=get_refreshed_fragments’ in the results, with a loading delay sometimes of a few seconds. Some say it’s a woocommerce issue, others not.

    I’ve stripped out any extraneous plug-ins and just running the template and woo-commerce plug-in and still get the same message.

    I was having similar issues with ajax-admin slow loading problems but traced that to a plug-in

    I’ve read this thread: https://wordpress.org/support/topic/wc-ajaxget_refreshed_fragments-1/page/2?replies=2

    Which, after what I’ve done so far, suggest that it’s a hosting issue, which I will bring up with my hosting provider.

    I ran the Chrome network tool from my browser and have a 4.85s loading time on the offending file.

    Is there any definitive answer to this yet?

    https://wordpress.org/plugins/woocommerce/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Since admin-ajax was also slow for you, I suspect the same underlining cause is making wc-ajax slow. WooCommerce used to use admin-ajax but switched over in 2.4 I believe for speed. Both are still essentially just making ajax calls to the db though.

    You did try turning of geolocation right and then checked pingdom again? Seems that was the issue with pingdom.

    There isn’t a definitive answer because it can be any number of things, but yes, it is definitely closely related to your web hosting and the resources you have there.

    Thanks Caleb. It’s very frustrating, epecially seeing these additional delays applying to pages that have no WC elements on them, like my home page. As for the geolocation I have ‘Default Customer Location’ turned to ‘No Location by default’. Makes no difference that I can see.

    I had a look at the Woo Showcase https://woocommerce.com/showcase/ and plenty of stores in the list display the same issue, although not all. I’m using shared hosting, but it’s not the $0.99 a month type package. Any ideas on what I should switch to that might sort the problem… not necessarily a particular company but a basic spec that would do the job.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Do you have a mini cart on every page, like in the header perhaps?

    Also, could you post your system status report here: https://wordpress.org/support/topic/before-posting-gather-the-following-details

    Thanks Caleb, status below.
    In the top bar of each page there is a small link to the cart showing items in the cart. But it’s not like the mini-cart I’ve seen in other screengrabs.

    ### WordPress Environment ###
    
    Home URL: http://www.mtfu.co.uk
    Site URL: http://www.mtfu.co.uk
    WC Version: 2.6.4
    Log Directory Writable: ✔
    WP Version: 4.5.3
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_GB
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.18 (Unix)
    PHP Version: ❌ 5.5.38 - We recommend a minimum PHP version of 5.6. See: How to update your PHP version
    PHP Post Max Size: 64 MB
    PHP Time Limit: 120
    PHP Max Input Vars: 1000
    cURL Version: 7.19.7
    NSS/3.19.1 Basic ECC
    
    SUHOSIN Installed: –
    Max Upload Size: 64 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 2.6.4
    :
    woocommerce_sessions: ✔
    woocommerce_api_keys: ✔
    woocommerce_attribute_taxonomies: ✔
    woocommerce_downloadable_product_permissions: ✔
    woocommerce_order_items: ✔
    woocommerce_order_itemmeta: ✔
    woocommerce_tax_rates: ✔
    woocommerce_tax_rate_locations: ✔
    woocommerce_shipping_zones: ✔
    woocommerce_shipping_zone_locations: ✔
    woocommerce_shipping_zone_methods: ✔
    woocommerce_payment_tokens: ✔
    woocommerce_payment_tokenmeta: ✔
    
    ### Active Plugins (18) ###
    
    301 Redirects: by Tony Spiro – 0.3
    Contact Form Builder: by WebDorado – 1.0.50
    Simple Custom CSS and JS: by Diana Burduja – 2.4
    EWWW Image Optimizer: by Shane Bishop – 2.9.6
    FooBox Free Image Lightbox: by FooPlugins – 1.0.12
    Foo Gallery: by FooPlugins – 1.2.13
    Heartbeat Control: by Jeff Matson – 1.0.3
    PayPal for WooCommerce: by Angell EYE – 1.2.3
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6
    UpdraftPlus - Backup/Restore: by UpdraftPlus.Com
    DavidAnderson – 2.12.18.22
    
    W3 Total Cache: by Frederick Townes – 0.9.4.1
    WooCommerce Weight Based Shipping: by dangoodman – 4.1.4
    WooCommerce Quantity Increment: by Automattic
    WooThemes – 1.1.0
    
    Woocommerce Shipping Gateway per Product: by Dreamfox Media – 1.2.2
    WooCommerce: by WooThemes – 2.6.4
    Yoast SEO: by Team Yoast – 3.4.2
    WP Construction Mode: by SmartCat – 3.31
    YIKES Custom Product Tabs for WooCommerce: by YIKES Inc – 1.4.4
    
    ### Settings ###
    
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    
    ### API ###
    
    API Enabled: ✔
    
    ### WC Pages ###
    
    Shop Base: #3078 - /the-store/
    Basket: #2992 - /basket/
    Checkout: #2993 - /checkout/
    My Account: #2994 - /my-account/
    
    ### Taxonomies ###
    
    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    ### Theme ###
    
    Name: RT-Theme 18
    Version: 1.9.6
    Author URL: http://themeforest.net/user/stmcan
    Child Theme: ❌ – If you're modifying WooCommerce on a parent theme you didn't build personally
    then we recommend using a child theme. See: How to create a child theme
    
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: rttheme18/woocommerce/archive-product.php
    rttheme18/woocommerce/cart/cart.php version 2.1.0 is out of date. The core version is 2.3.8
    rttheme18/woocommerce/cart/cross-sells.php
    rttheme18/woocommerce/content-product.php
    rttheme18/woocommerce/content-product_cat.php
    rttheme18/woocommerce/global/wrapper-end.php
    rttheme18/woocommerce/global/wrapper-start.php
    rttheme18/woocommerce/loop/loop-end.php
    rttheme18/woocommerce/loop/loop-start.php
    rttheme18/woocommerce/loop/price.php
    rttheme18/woocommerce/single-product/product-image.php version 2.0.14 is out of date. The core version is 2.6.3
    rttheme18/woocommerce/single-product/related.php
    rttheme18/woocommerce/single-product/tabs/additional-information.php
    rttheme18/woocommerce/single-product/tabs/tabs.php
    rttheme18/woocommerce/single-product/title.php
    rttheme18/woocommerce/single-product/up-sells.php
    rttheme18/woocommerce/single-product-reviews.php
    
    : Learn how to update outdated templates

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    In the top bar of each page there is a small link to the cart showing items in the cart. But it’s not like the mini-cart I’ve seen in other screengrabs.

    That is probably still using the wc-ajax. Removing it entirely could help with page load.

    Though now that I’ve been to your site – I don’t think that is really the issue. Selecting variations and adding to cart took quite a while. Like a couple of seconds of waiting after selecting add to cart.

    It seems that your hosting is quite underpowered. Perhaps consider upgrading your hosting account? The lowest plan on a shared hosting account probably won’t be the best option for an eCommerce store.

    Thanks Caleb. It’s not the absolute cheapest hosting plan… but yeah, it could be faster. How would faster hosting remove the issue? I can see the benefits of a faster host, but how will that get rid of the ‘?wc-ajax=get_refreshed_fragments’ issue. Or does it simply reduce it to a negligible overhead?

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    There probably isn’t necessarily an issue, as much as your database / site just isn’t able to process what is needed fast enough. A car that can only run 10mph still works, but is problematic.

    Looking at the ajax call to get a variation, I see this: http://cld.wthms.co/1iizZ/ZiIPYnrz. The TTFB (time to first byte) is a bit high along with the initial connection. So connecting to the server/database is what’s taking the longest of all requests. The same thing happens with the get_refreshed_fragments call w/ a 1.20s ttfb.

    Here are some hosts to look into: https://wordpress.org/hosting/. Personally, I’m a fan of Siteground. Here are a few more options as well: https://woocommerce.com/hosting-solutions/.

    It may not be your current hosts fault though, just need a higher plan for an eCommerce store as your site is more that static content like a blog 🙂

    Thanks Caleb, funny you should mention siteground. I switched to them 2 days ago and am inpressed by the general snappiness of the site now. And the admin area responds faster too. It hasn’t removed the ‘the get_refreshed_fragments’ call, but overall the response feels faster. Plus they provide an SSL as part of the package.

    Just one thing remaining… which popped up yesterday, after the site was migrated. Product listings are now showing prices exc. Tax, but on the single product page they show inc tax.

    Does it ever stop?

    Hi All,

    I am new to this forum, so sorry in advance if I post my message on the wrong place, or in a to old spot.

    I am currently having problems with a error message in “google pagespeed insight”. I used W3TC and Autoptimize, but still the error is there.

    Error: https://www.joyatoys.nl/?wc-ajax=get_refreshed_fragments

    Does somebody know how to fix?

    First time im helping out people in wordpress.org so be nice 🙂

    I found a code to stop refreshed fragments in all the site but that thing returned errors in variable products: ” ReferenceError: wc_cart_fragments_params is not defined ” (check that in chrome console)

    Soooo… I modify that code to ONLY stop fragments in ‘page’ and ‘post’ using is_singular().

    here it is, hope it helps. Add to funtions.php in your child theme:
    add_action( ‘wp_enqueue_scripts’, ‘dequeue_woocommerce_cart_fragments’, 11); function dequeue_woocommerce_cart_fragments() { if (is_front_page() || is_singular(‘page’) || is_singular(‘post’) ) wp_dequeue_script(‘wc-cart-fragments’); }

    IF you want, you can delete ” || is_singular(‘page’) ” to allow fragments in pages
    or you can delete ” || is_singular(‘post’) ” to allow them on posts.
    Also delete is_front_page() and it will allow fragments in home page

    Good luck people!

    • This reply was modified 2 years, 1 month ago by  germanmazza. Reason: added where to paste the code
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘?wc-ajax=get_refreshed_fragments – slow loading’ is closed to new replies.