ESI and wp nonce
-
Hi,
I created a custom nonce in “wp_localize_script” and use it in jQuery.
Without ESI it expires every day (I think even 12 hours).
I added “my-nonce-sample private” in “LiteSpeed Cache Settings -> Cache -> ESI -> ESI Nonce”. After purge got this error in front:
Console:
Uncaught ReferenceError: __litespeed_var_0__ is not defined
Source:
<script>var __litespeed_var_0__="[an error occurred while processing this directive]";</script>
Also i added this line before my “wp_localize_script”:
do_action( 'litespeed_nonce', 'my-nonce-sample' );
This cause my Ajax object corrupted:
var ajax_object = {"ajax_url":"https:\/\/domain.com\/wp-admin\/admin-ajax.php","wp_nonce":"[an error occurred while processing this directive]"};
Report number: FSNWONNE
What is causing this problem and how to solve this?
- The topic ‘ESI and wp nonce’ is closed to new replies.