• Resolved classictubetv

    (@classictubetv)


    Hello LiteSpeed Team,

    I have an issue where your plugin is preventing a backend AJAX save function from working correctly. When LiteSpeed Cache is active, the function fails. When I deactivate the plugin, it works perfectly.

    The Specific Action: I am in the WordPress editor for a post. I am using the “JetEngine” plugin, which has a meta box for managing related posts. When I try to manually re-order these posts and click the “Save order” button, the change does not save.

    The Technical Error: We used the browser’s developer console and discovered that when LiteSpeed is active, the edit page contains multiple HTML elements with a non-unique ID of #_ajax_nonce. This causes the WordPress security check to fail, and the AJAX save request is rejected.

    Troubleshooting Steps Already Taken: I have already tried the following settings, and none of them have resolved the issue:

    • Set “Cache Logged-in Users” to OFF.
    • Added /wp-admin/ to the “URI Excludes” in Page Optimization.
    • Individually disabled JS Minify, JS Combine, and Load JS Deferred.

    Could you please provide a specific setting, or a more precise URI/script handle that I can exclude from your plugin’s optimizations to prevent this AJAX nonce conflict in the wp-admin area?

    Thank you for your help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support litetim

    (@litetim)

    Thread Starter classictubetv

    (@classictubetv)

    @litetim That didn’t work. When I change the position (in this case actors) when I click save, it slides back to the previous position. When I disable the plugin it works. Yes, I cleared the cache and cleared my web host cache.

    • This reply was modified 8 months, 2 weeks ago by classictubetv.
    Plugin Support litetim

    (@litetim)

    @classictubetv what is your hosting company?

    Thread Starter classictubetv

    (@classictubetv)

    Hostinger

    Plugin Support litetim

    (@litetim)

    @classictubetv do you have Hostinger specific plugins activated?
    Disable them and turn OFF Cache Rest API(https://docs.litespeedtech.com/lscache/lscwp/cache/#cache-rest-api)

    Thread Starter classictubetv

    (@classictubetv)

    I have disabled the “Cache REST API” setting and purged all caches and deactivated Hostinger Tools plugin. Unfortunately, the problem still exists. The backend save function only works if I completely deactivate the LiteSpeed Cache plugin.

    I think the conflict is with a Page Optimization feature (like JS Minify or Combine), not a caching feature. The JavaScript on the page is likely being altered in a way that breaks the save function.

    Could you please tell me how to completely disable all Page Optimization features (JS, CSS, etc.) only for the entire WordPress admin area (/wp-admin/)?

    I have already tried adding /wp-admin/ to the URI Excludes in Page Optimization, but that did not work.

    Thank you.

    Plugin Support qtwrk

    (@qtwrk)

    wp-admin is not being optimized at all , all its js / css should be the same as before

    2 others thing might be related , please try disable them if you have enabled , 1) ESI, 2) object cache.

    Thread Starter classictubetv

    (@classictubetv)

    Problem solved, root cause found.

    The problem was caused by the Object Cache.

    When I go to LiteSpeed Cache > Cache > Object and turn the Object Cache to OFF, the backend AJAX save function for my JetEngine relations works perfectly. When it is ON, it fails.

    My server has both the Memcached and Redis extensions enabled. I have it set to Memcached.

    Can you please advise on why your Object Cache implementation would be causing this conflict with backend AJAX nonces? Is there a way I can configure it correctly (perhaps by excluding certain groups from the object cache) so I can use its performance benefits without it breaking my site’s backend functionality?

    Thanks again for your help.

    Plugin Support qtwrk

    (@qtwrk)

    is it a real nonce ? I mean like through the wordpress nonce function ?

    because the wp nonce usually last several hours at least, even object cache incorrectly caches it , it should last longer then immediate failure

    maybe the jetengine is doing custom security token or something ?

    please try check the trace how was that “nonce” generated in jetengine

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Backend AJAX Save Function Fails with JS Optimization Active’ is closed to new replies.