How to update Akira theme to latest version? Click here.

Okay
  Public Ticket #4162641
Suggestion: Add deferRequestBy to nrtsearchbar autocomplete to prevent 500 errors on fast typing
Open

Comments

  • semfly started the conversation

    Hi Axon/Akira Theme Team,

    We’re using your theme along with the included nrtsearchbar module, and we've noticed a critical performance issue related to the live search functionality.

    Problem

    When users type quickly in the search bar, the module sends multiple POST requests to /search in rapid succession. This causes our server to respond with 500 Internal Server Errors.

    This issue appears to be caused by the lack of a debounce/delay mechanism before triggering the AJAX request in the devbridgeAutocomplete configuration.

    Proposed Solution

    The devbridgeAutocomplete library already supports a built-in option called deferRequestBy.
    We suggest simply adding the following to your JS initialization:

    deferRequestBy: 500,
    

    This should be included here (in front.js or front.min.js):

    i.find("input[name=s]").devbridgeAutocomplete({  serviceUrl: e,  appendTo: s,  type: "POST",  dataType: "json",  paramName: "s",  minChars: 3,  deferRequestBy: 500,  params: { resultsPerPage: r, nrtAjax: 1 },  ...
    });
    
    Benefits
    • Prevents excessive server load and 500 errors

    • Improves UX (no more broken searches while typing fast)

    • Clean, native solution — no need for custom debounce logic

    Could you please consider integrating this into the next version of the theme/module?

    Let me know if you need any logs or examples from our server — I’d be happy to share.

    Thanks for your support and for the great theme!

    Best regards,
    Semfly SRL

  •  417
    Naik replied

    Thank you so much for this helpful sharing!

    We will include it in the next update as soon as possible.

    Best regards,

    Naik - Lightatend Team 

    A good review and positive comment would help us to keep doing what we do best Rate now

    Our support time Monday-Saturday (9am-6pm GMT+7)