We have Litespeed proxying request to a backend server, which happens to be Varnish - we do this because Varnish does not have SSL support and the Varnish backend has a lot more memory in it than the webserver.
Unfortunately we are not able to purge items from the Litespeed cache, no matter what we try, they never get purged. It's very random though, sometimes the request is met with a 200 Purged, sometimes with a 405 Method Not Allowed:
Other times:
Either way, the request for the image returns:
However it should return:
As you can see, Varnish has a much larger image (as I swapped a tiny image for a much bigger one) in its cache - which is the same image as is on disk right now. Litespeed resolutely refuses to purge the item from the cache, even when it says it has done it, it's always the original image.
Unfortunately we are not able to purge items from the Litespeed cache, no matter what we try, they never get purged. It's very random though, sometimes the request is met with a 200 Purged, sometimes with a 405 Method Not Allowed:
Code:
curl -X PURGE https://<domain>:8443/karl-test.png -I
HTTP/1.1 200 Purged
Content-Length: 0
Date: Wed, 06 Jul 2016 10:55:05 GMT
Accept-Ranges: bytes
Server: LiteSpeed
Connection: close
Code:
curl -X PURGE https://<domain>:8443/karl-test.png -I
HTTP/1.1 405 Method Not Allowed
Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
Pragma: no-cache
Content-Type: text/html
Content-Length: 612
Date: Wed, 06 Jul 2016 10:59:41 GMT
Accept-Ranges: bytes
Server: LiteSpeed
Connection: Keep-Alive
Code:
curl -X GET https://<domain>:8443/karl-test.png -I
HTTP/1.1 200 OK
Content-Type:
X-Varnish: 138641631 129828259
Age: 4035
Via: 1.1 varnish-v4
Accept-Ranges: bytes
X-Litespeed-Cache: hit
Content-Length: 9306
Date: Wed, 06 Jul 2016 10:59:33 GMT
Server: LiteSpeed
Connection: Keep-Alive
Code:
curl -X GET http://<varnish>/karl-test.png -I
HTTP/1.1 200 OK
Content-Length: 86152
Content-Type:
Date: Wed, 06 Jul 2016 10:58:00 GMT
X-Varnish: 138641775 136086639
Age: 530
Via: 1.1 varnish-v4
Connection: keep-alive
Accept-Ranges: bytes