Probled with ESI shortcode and wp_enqueue_script




Wordpress LScache Plugin: Probled with ESI shortcode and wp_enqueue_script

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello! We have a problem with WP Litespeed server esi shortcodes and wp_enqueue_script function. We have a shortcode that enqueues scripts only on pages where the shortcode is used. But when using ESI in shortcode -> it doesnt enqueue those custom styles and scripts. Does anyone know a workaround or should we just enqueue these script on every page? Hi, because ESI is a sub-request that happens AFTER the main request , so you can not really load more things into a page that is already sent and rendered by browser maybe try embed the css or js into the shortcode output directly best regards,



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference