Stale Autocomplete Nonce

  • inclind
    Participant
    2 months ago #53347

    With the autocomplete/suggestions search, it seems like a nonce is being generated during page load and stored in the markup.
    Example: <input type="hidden" id="wpsolr_autocomplete_nonce" value="88af705964">
    If the page’s markup is cached for more than 24 hours, that value seemingly becomes invalid, and I’m seeing no visible behavior in the search box and an error returned in the dev console.
    Error: Uncaught SyntaxError: Unexpected end of JSON input
    If I manually replace the nonce with a fresh value in the markup, the search then functions.

    Is there a configuration option or some other approach that would allow this to function but also be able to cache pages for >24h?

    wpsolr
    Keymaster
    1 month, 4 weeks ago #53369

    This is indeed the default validity of 24 hours for WP nonces.

    Apart from executing a js code, every 12 h for instance, that calls an Ajax PHP code to update the current footer nonce, I do not see a solution to that.

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

You must be logged in to reply to this topic.