Wordpress LScache Plugin: ESI and wp nonce
Last Updated on: Wed, 15 Apr 2026 00:00:02 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: var __litespeed_var_0__=[an error occurred while processing this directive] 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? Hi, please enable debug log , see if there is entry about ESI in the log Best regrds, Yes, this section of logs related to this ESI: 09/15/21 10:44:25.298 [xxx.xxx.33.83:57096 2 lX7] [ESI] Appended nonce action to nonce list [action] my-nonce-sample 09/15/21 10:44:25.299 [xxx.xxx.33.83:57096 2 lX7] [ESI] param --- array ( action => my-nonce-sample, _ls_silence => true, ) 09/15/21 10:44:25.299 [xxx.xxx.33.83:57096 2 lX7] [ESI] md5_string=nonceeyJhY3Rpb24iOiJwZW1pbmEtbGFuZGluZ3MtYWpheCIsIl9sc19zaWxlbmNlIjp0cnVlfQ== 09/15/21 10:44:25.299 [xxx.xxx.33.83:57096 2 lX7] [ESI] [BLock_ID] nonce [wrapper] wp_create_nonce my-nonce-sample [Control] 09/15/21 10:44:25.299 [xxx.xxx.33.83:57096 2 lX7] 09/15/21 10:44:25.299 [xxx.xxx.33.83:57096 2 lX7] [ESI] Preserved to 0ddf77f31f9fd0db107c7a0059694d6d Hi, now this is interesting issue please create a ticket by mail to support at litespeedtech.com , our staff who specialized in ESI will investigate it further with you Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference