Wordpress LScache Plugin: Problem with ESI
Last Updated on: Wed, 15 Apr 2026 00:00:02 When litespeed cache plugin is on page views counter doesnt work. Im trying to exclude from cache page views counter (https://pl.wordpress.org/plugins/page-views-count/). I added snippet: add_action( litespeed_esi_load-my_esi_block, my_esi_block_esi_load ) function my_esi_block_esi_load() #do_action( litespeed_control_set_ttl, 300 ) do_action( litespeed_control_set_nocache ) include ( /wp-content/plugins/page-views-count/page-views-count.php ) and I included filter in the code like this (Im using Oxygen Page Builder code block to insert this): It returns warnings: Warning: include(/wp-content/plugins/page-views-count/page-views-count.php): failed to open stream: No such file or directory in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()d code on line 8 Warning: include(): Failed opening /wp-content/plugins/page-views-count/page-views-count.php for inclusion (include_path=.:/usr/local/php/7.4/7.4.15-dh36/lib/php) in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()d code on line 8 Can you help me and tell where the problem is? This topic was modified 1 year, 2 months ago by pzxyz. This topic was modified 1 year, 2 months ago by pzxyz. The page I need help with: https://tattoocoper.pl/ Hi, /wp-content/plugins/page-views-count/page-views-count.php dont use absolute path like this , make it relative path or full path with correct path in your case , /home/[?]/public_html/wp-content/plugins/page-views-count/page-views-count.php Best regards, Thank you. With relative path: add_action( litespeed_esi_load-my_esi_block, my_esi_block_esi_load ) function my_esi_block_esi_load() #do_action( litespeed_control_set_ttl, 300 ) do_action( litespeed_control_set_nocache ) include ( page-views-count.php ) I have 3 warnings: Warning: include(page-views-count.php): failed to open stream: No such file or directory in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()d code on line 8 Warning: include(page-views-count.php): failed to open stream: No such file or directory in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()d code on line 8 Warning: include(): Failed opening page-views-count.php for inclusion (include_path=.:/usr/local/php/7.4/7.4.15-dh36/lib/php) in /home/[...]/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()d code on line 8 With absolute path I have fatal error: Fatal error: Cannot redeclare a3_pvc_load_plugin_textdomain() (previously declared in /home/[...]/public_html/wp-content/plugins/page-views-count/page-views-count.php:74) in /home/[...]/public_html/wp-content/plugins/page-views-count/page-views-count.php on line 74 How to make things work? well ? you cant just include the file , its bit of complicated then that a simpler solution is to find a post counter plugin that uses ajax call or WP REST to get the counter , instead of making ESI block
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference