I have some additional information from the LiteSpeed development team:
The first one is inside of an if condition.
if ( $action && in_array( $action, $requests ) ) {
Try updating it to this:
if ( wp_doing_ajax() && $action && in_array( $action, $requests ) ) {
Not sure if it will work, but the overall problem that he is trying to resolve is to try to cache ajax requests. This will not happen normally because ajax requests are always in wp-admin, so he is trying to circumvent this
I hope this helps.
Woo Variations inadvertently enables WP-Admin caching in LiteSpeed Cache
Lisa Clarke
Hello.
I am having a problem with my WP-Admin Product, Post, Page, and Media pages being cached by LiteSpeed Cache, even though LiteSpeed does not cache WP-Admin.
I found the following lines of code, which turn
DONOTCACHEPAGE
false. LiteSpeed uses theDONOTCACHEPAGE
constant to indicate that WP-Admin pages should not be cached. By changing the value tofalse
, you are overriding that behavior, and effectively marking WP-Admin pages as cacheable. For now, I have addedwp-admin
to the Do Not Cache URLs section as a work-around, but hopefully this is something you can fix in a future update. Thanks!