Clear cache on a PROXY setup with Openlitespeed being upstream from multiple downstream wordpress servers all on different IP's

#1
HI I am running PROXOX with several virtual hosts.

My openlitespeed installation is on a VM with IP 10.0.0.24. I run a VHOST with a PROXY for https://smartwebdesign.at there. The SERVER CONFIGURATION has a EXTERNAL APP that points to 10.0.0.50 for my Wordpress server for www.smartwebdesign.at. The vhost has a cache on 10.0.0.24 that points to "$VH_ROOT/lscache".

So the cache for the VHOST is on 10.0.0.24 but the vhost wordpress install is on 10.0.0.50.

Problem: If I am on my Wordpress install on 10.0.0.50 and hit PURGE CACHE It does not work as the cache files are on a different IP upstream from my wordpress install.
Caching works but flushing the cache does not. I know I can delete the cache directory on 10.0.0.24 but its not optimal as I have to do it constantly as its a dev wordpress web server. The reason why Litespeed is upstream from the vhost and on a different IP is that I want a scalable solution and be able to quickly deploy new Wordpress servers with different IPs.

Can anyone think of a solution to make the FLUSH cache work from wordpress even though the cache/litespeed sits on a different IP ?
 

LiteCache

Active Member
#3
I don't think so. Purging the cache with this custom condition will work in a native environment, but not if the cache has to be purged by a cache plugin like LSCWP.

@Big Boss
What happens if you purge the cache by using x-litespeed-purge header and executed in related user/domain?

Code:
<?php
header('x-litespeed-purge:*');
 
#4
SPOT ON!! The PHP code works while using the Wordpress Litespeed plugin and hitting "PURGE ALL" fails.
The code will help already a lot! Many, many thanks for pointing that out!!!! (y)
Is there any way to make the purge from the wordpress cache plugin work ? Just wonder why one works and the other fails :rolleyes:

Just to add: the wordpress litespeed plugin on server on 10.0.0.50 is giving me the warning "LSCache caching functions on this page are currently unavailable!" I guess this is because the Litespeed server is on 10.0.0.24 and acts as a proxy to 10.0.0.50 so there is no litespeed server on 10.0.0.50. I guess that would explain why the PURGE ALL from the wordpress plugin fails. Is there any way to inform the LITESPEED PLUGIN on 10.0.0.50 that the litespeed server/cache/vhost is on 10.0.0.24 so that the PURGE ALL and all other litespeed functions from the wordpress plugin work ?
 
Last edited:

LiteCache

Active Member
#6
Then you should not see the cache warning anymore. Also, the cache purge within the LiteSpeed plugin works.
I'm sorry, but I don't think the proxy configuration will solve the problem. Otherwise, purging the cache using the native PHP purge header would not work. I see the problem in the IP addresses used, which are not public IP addresses. The purge function of the cache plugin is an HTTP request that uses the resolved public IP address of the domain. However, the private IP addresses used cannot be resolved via the domain request. That's why, in my opinion, any attempt to purge the cache using the plugin will fail.

But I would like to be proven wrong...
 
Top