Home Forums WoodMart support forum Ajax Loading Very Slowly

Ajax Loading Very Slowly

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #52835

    tekhnologica
    Participant

    Hi,

    I’m having issues with ajax on my website. When adding items to the cart, it’s a little slow but OK for about the first 3 items, then upon trying to add a 4th item, the ajax spinner just spins and spins forever and never updates. The same goes for removing items from the cart, except I haven’t seen it spin forever (it will eventually remove the product, it just takes a LONG time). I don’t want to disable ajax, but would rather have it work as intended. Any ideas what might be causing ajax slowness? Thanks

    #52837

    tekhnologica
    Participant

    I see that I’m getting this error when attempting to add an item to the cart via ajax:

    HTTP502: BAD GATEWAY – The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.
    (XHR)POST

    Again, this only occurs when adding more than 3 unique items to the cart.

    #52840

    tekhnologica
    Participant

    So I found a fix for the issue: I increased the buffer size on the server. This was the full error text:

    2018/04/17 02:23:24 [error] 54028#54028: *29421 upstream sent too big header while reading response header from upstream, client: [IP REDACTED], server: [REDACTED], request: “POST /?wc-ajax=add_to_cart HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php7.0-fpm.sock:”, host:[REDACTED], referrer: [REDACTED].

    However, is this potentially an issue? e.g. are the headers sent actually bigger than they should be?

    #52849

    Artem Temos
    Keymaster

    Hi,

    These AJAX requests are built and executed by WooCommerce and we don’t know if there is some problem with its header size. But most likely the buffer size on your server was too small and you can keep this fix without any worries.

    Regards

Viewing 4 posts - 1 through 4 (of 4 total)