Wordpress LScache Plugin: Need some improvements Cloudflare + Forced Cache + Specific Ajax + SpecifiJSON
Last Updated on: Wed, 15 Apr 2026 00:00:02 Overall great but it still needs some improvements to completely blow off WP-Rocket. 1. Cloudflare Automatic Purge Support ? Whenever LS purges local cache it should also automatically purge cache in Cloudflare (using cache everything rule in Cloudflare to serve cached files from Cloudflare) 2. Alongside x-litespeed-cache header if it can also adjust it headers so page can be cached with Cloudflare cache-everything rule (expires header based on TTL + cache control to make it cacheable for that purpose) 3. In my opinion, Forced Public Cache should not override Exclude Cache , excluding something means it is not cacheable and intention of Forced Public Cache should be to force cacheable things to cache as public cache but at present it override excludes rules and make non-cacheable ? cacheable as public cache. 4. Make specific ajax calls cacheable 5. Make specific json calls cacheable This topic was modified 1 year, 6 months ago by tusharsethi69. Hi, Thanks for the suggestion, 1) its not possible , LiteSpeed Cache is a tag-based cache system which is only recognized by LiteSpeed , other webserver will ignore it 2) mostly same as 1) , and putting expire/cache-control header over dynamic page is not exactly a good idea , in my humble opinion. 3) noted and will look into it 4/5) please be more specific about the speciic in this context ? Best regards, Hi, Thanks for fast response. All these things that i am suggesting, you might give as a option in LS cache plugin settings for some advanced use cases. 1. What i mean is when LS purges its cache say for a page or post, i want LS to also purge same cache from Cloudflare too via cloudflare API, this thing is already done by WP Rocket via its cloudflare integration. Purpose is i have configured cloudflare to cache these html doc pages (as served by WP Rocket from its local cache) using Cloudflare cache everything rule. So for all subsequent visits are served directly from Cloudflare. When WP Rocket purges its local cache say for a post or page it also purge cache for such post or page in Cloudflare also. Hope i am detailed enough now. 2. Ok but atleast have to remove such headers that prevent cloudflare to apply cache everything rule to cache dynamic pages (like cache-control: no-cache, etc) 3. OK 4/5. Specific here means i want to specifically cache or exclude from cache particular ajax or json calls. Both ajax & json/rest calls have unique identifiers which can be used as a criteria to decide whether it should be cached or not. Like ajax calls have action identified. 6. ADDITIONAL POINT ? With dynamic pages cached some forms or http calls to website does not work due to expired or used nonces. But in some cases we may prefer them to work without nonces than to not work while using page cache, for this we can use some whitelisting or blacklisting to bypass nonce checks like using below code (using in my website ? yeah it defeats the purpose of nonces but it can be handfull in non-risky/light use cases where we can afford loosing nonces for functionality) Below code bypass nonce check for particular ajax calls as identified via their action ? add_action(admin_init,function() if(defined(DOING_AJAX) && DOING_AJAX) $action = ($_REQUEST[action]??null) $whitelisted_actions = [dokan_pageview,dokan_report_abuse_get_form] if($action && (array_search($action,$whitelisted_actions)!==false)) $_REQUEST[$action] = wp_create_nonce($action) 1) Hi, 1) We have own our CDN project for caching dynamic pages at CDN level. 2) LSCWP doesnt touch such header in any circumstances , only gives expire header over static requests when you enable browser cache 4/5) I am not exactly sure what is the JSON in this context, but we do have options to cache REST, isnt it ? for ajax , I think you can use force (public) cache options you mentioned in 3) to force cache ajax call 6) We have ESI nonce for using nonce on cached page and work around the used/expired nonce https://docs.litespeedtech.com/lscache/lscwp/cache/#esi-nonce https://docs.litespeedtech.com/lscache/lscwp/api/#convert-custom-nonce-to-esi Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference