Plugin Support
qtwrk
(@qtwrk)
Hi,
yes , because when you do normal way for edit/save button , it triggers WP action to notify LSCWP to purge page while if you directly edit the database, this action won’t be fired thus LSCWP won’t be notified to purge cache
only way is you to purge the cache after you edit the database, either manually through wp-admin or programmatically by some PHP script or SSH command line
Best regards,
Thread Starter
Rezar
(@rezionline)
Thanks for your help. How can I instruct the plugin to execute purge cache command via the database?
Plugin Support
qtwrk
(@qtwrk)
Hi,
well , you can’t call to PHP site from database …
Best regards,
Thread Starter
Rezar
(@rezionline)
How can I do this programmatically by PHP script or SSH command line?
Plugin Support
qtwrk
(@qtwrk)
Hi,
if you want to purge all , you can create a php script with code :
<?php
define( 'WP_USE_THEMES', false );
require( './wp-load.php' );
if ( defined( 'LSCWP_V' ) ) {
do_action( 'litespeed_purge_all' );
}
echo "done";
then access it by curl , like curl https://your_domain.com/purge.php , then it will do a purge all
you can use do_action( 'litespeed_purge_url', 'the_url' ); to purge a specific URL , where the_url you can use something like query string to pass into the script
Best regards,
Thread Starter
Rezar
(@rezionline)
I used both of these codes.
After running it, I see a Purge cleared message in my WordPress panel.
But the cache is not cleared in my website. And until I update a post manually in WordPress, the cache will not clear.
What is the reason?
Plugin Support
qtwrk
(@qtwrk)
if you use do_action( 'litespeed_purge_all' ); this one , does it work ?
was “curl https://your_domain.com/purge.php” the domain is same as your site domain ?
and also please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”
-
This reply was modified 4 years, 11 months ago by
qtwrk.
Thread Starter
Rezar
(@rezionline)
Yes, the domain is same as your site domain. I use do_action( 'litespeed_purge_all' ); code now But it does not work.
The report info:
Report number: IILUJQJB
Report date: 04/15/2021 19:44:11
-
This reply was modified 4 years, 11 months ago by
Rezar.
Plugin Support
qtwrk
(@qtwrk)
Hi,
please enable debug log , then run the cron , see if it gets the purge call
Best regards,
Thread Starter
Rezar
(@rezionline)
Hi,
I did these things but I did not see the purge call in the report
There is also this message. Is it related? :
Unexpected cache rule ExpiresDefault found in .htaccess file. This rule may cause visitors to see old versions of pages due to the browser caching HTML pages. If you are sure that HTML pages are not being browser cached, this message can be dismissed. (Learn More)
Plugin Support
qtwrk
(@qtwrk)
Hi,
did you put it on same dir as your wp-config.php ?
no , expiresdefault is different thing , it has nothi to do with this , it happens usually when you have duplicated expire directives in your .htaccess, try de-duplicate it
Best regards,
Thread Starter
Rezar
(@rezionline)
What should I put in the wp-config.php?
Plugin Support
qtwrk
(@qtwrk)
Hi,
no , not in the wp-config.php , but same directory as your wp-config.php is
Best regards,
Thread Starter
Rezar
(@rezionline)
Hello,
Yes, I put it in the same directory
So that the link was as follows: https://my_domain.com/purge.php
And inside it contains this code:
<?php
define( 'WP_USE_THEMES', false );
require( './wp-load.php' );
if ( defined( 'LSCWP_V' ) ) {
do_action( 'litespeed_purge_all' );
}
echo "done";
?>
I hope it is true
-
This reply was modified 4 years, 11 months ago by
Rezar.
Plugin Support
qtwrk
(@qtwrk)
try reverse these 2 lines in above code
}
echo "done";
run again , see what it says
-
This reply was modified 4 years, 11 months ago by
qtwrk.