Problem deleting / (root) cache entry

mistwang

LiteSpeed Staff
#4
It probably related to the way how cache is enabled for "/" URL.
For some reason, cache was not enabled for that page with PURGE request.
Like in a situation that rewrite rule enable cache only when request method is "GET".
 
#5
How do I figure out what the real URL is then? Is there a way to get a list of cached entries in the system? If the request works via "/" and states it is cached why doesn't then PURGE work?
 
#6
Status: HTTP/1.1 200 OK
Date: Thu, 15 Aug 2013 18:52:33 GMT
Server: LiteSpeed
Connection: close
Transfer-Encoding: chunked
Vary: User-Agent
X-LiteSpeed-Cache: hit
X-Powered-By: PHP/5.3.25
X-Pingback: http://investorjunkie.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
X-W3TC-Minify: On

So if a HTTP request works this way via the URI, why doesn't PURGE/REFRESH commands work the same?? This sounds like a bug to me.
 
Last edited:

NiteWave

Administrator
#8
the cached file don't look helpful --- but great you can dig it out

please paste the rewrite rules which lead to cache "/"
(can omit rules to cache other URLs)
 
#9
the cached file don't look helpful --- but great you can dig it out

please paste the rewrite rules which lead to cache "/"
(can omit rules to cache other URLs)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Other items are in the .htaccess file for W3TC.
 

mistwang

LiteSpeed Staff
#12
It does not matter if you do not use it.
Just let us know how you enabled page cache for that site?

From LSWS console cache tab? content level cache configuration? Apache directive?

So, we can try to reproduce this issue and come up with a solution.
 
#13
It does not matter if you do not use it.
Just let us know how you enabled page cache for that site?

From LSWS console cache tab? content level cache configuration? Apache directive?

So, we can try to reproduce this issue and come up with a solution.

Cache Storage Settings
Storage Path /usr/local/lsws/cache
Max Object Size 128000

Cache Policy
Enable Cache Yes
Cache Expire Time (seconds) 86400
Cache Stale Age (seconds) Not Set
Cache Request with Query String No
Cache Request with Cookie Yes
Cache Response with Cookie Yes
Ignore Request Cache-Control Yes
Ignore Response Cache-Control Yes
Enable Private Cache No
Private Cache Expire Time (seconds) Not Set

Do-Not-Cache URL
wp-admin
wp-login.php
feed

Do-Not-Cache Domains
Not Set

running latest litespeed: 4.2.4
 

mistwang

LiteSpeed Staff
#16
The purge request must be sent to the IP that the vhost bound to, by default purge_cache_byrul.php uses 127.0.0.1, but the request cannot reach the vhost unless it also bound to 127.0.0.1 IP. Explicitly set the IP in the purge request works.
.../lsphp5 /usr/local/lsws/admin/misc/purge_cache_byurl.php -p investorjunkie.com / xx.xx.xx.xx
HTTP/1.0 200 Purged
Date: Wed, 21 Aug 2013 15:43:56 GMT
Server: LiteSpeed
Connection: close
Vary: User-Agent
 
#17
The purge request must be sent to the IP that the vhost bound to, by default purge_cache_byrul.php uses 127.0.0.1, but the request cannot reach the vhost unless it also bound to 127.0.0.1 IP. Explicitly set the IP in the purge request works.
Then why do other URLs work then? How can it work via 127.0.0.1 then since I need it to work via automated methods that don't add this.
 

mistwang

LiteSpeed Staff
#18
More investigation found that other URL works is due to a flaw in LSWS handling redirect.
when 127.0.0.1 is used, it goes to the Apache default vhost at /var/www/html, the URL does not exist, causes a redirect to /404.shtml, when redirect performed, LSWS uses the "Host" header to locate the vhost and found the cached URL. then purged.

For "/" URL, it does not perform the /404.shtml redirect.

To make it work reliably, add the IP to purge_cache_byurl.php parameter, it works for all URL.
 
Top