Even when I hack around the above problem, there’s a second issue, this time with Cli_Purge->supercacher->purge_everything()
. On my local test environment, that attempts to run the site-tools-client domain-all update id=%s flush_cache=1 path='%s'
command, which of course fails. This should presumably be skipped when away from SiteGround servers.
-
This reply was modified 3 years, 4 months ago by
Mark Barnes.
Hello @mark8barnes,
Thank you for your report!
We are aware of the issue and our developers are working on a fix.
Regards,
Vladimir
Thank you for the quick release of 7.0.2. This release partly fixes the issue. The purge command does now work, but with an important caveat. It exits with an exit code of ‘200’. I presume this is supposed to be equivalent to an HTTP status code of 200 OK, but anything other than an exit code of 0 is usually interpreted by bash scripts as an error. The plugin should exit with a code of 0 if the cache was successfully purged.
(In our case, we’re using BitBucket Pipelines, which assumes a build has failed if there isn’t an exit code of 0. I’ve had to write a bash script to check for an error code of 200 and convert it to 0!)
Hello @mark8barnes,
Could you please elaborate a bit more on how are you checking the exit code on your end to get the 200 response? In our tests the exit code when the cache is purged via cli is 0, as expected.
Could you please also specify your domain name and if your site is with SiteGround?
Best Regards,
Gergana Petrova
baseos | <redacted>@<redacted>.sgvps.net:~/www/samaritans-purse.org.uk/html$ wp sg purge
Success: SiteGround Optimizer assets folder purged successfully.
Success: File Cache Succesfully Purged.
Success: Dynamic Cache Successfully Purged.
baseos | <redacted>@<redacted>.sgvps.net:~/www/samaritans-purse.org.uk/html$ echo $?
200
Thanks for the response. My site is with SiteGround. You can see the domain name above. There’s a typo in the File Cache “Succesfully” message, by the way.
You’ve got halt(200)
commands all over purge_everything()
and purge_url()
.
Hello again,
We have already implemented a fix, so please update the plugin to the latest version -> 7.0.3.
Regards,
Vladimir
7.0.3 does seem to have fixed the issues. Thanks for the quick response. (And it’s worthwhile, because the file-based cache is much faster than v6.)