Hi Stanimir,
sorry to piggy back here, but I am after a definitive answer, and you being the plugin developer will definitely help:
I need to clear the whole SG cache stack (dynamic + memcache) programmatically from an external script, and I managed to do so using the helper function above from within my functions.php, with the help of a GET parameter (I know, not super elegant, but it works).
BUT… in my very very humble opinion, it does not have the same effect as clicking ‘Purge SG Cache’ from admin backend, which definitely clears the whole cache stack. Simple test:
– I run a script that changes the woocommerce product prices via a DB operation, and then invokes the sg_cachepress_purge_cache() via the get param trick described above (and I can see that the helper function returns true, meaning it has worked OK)
– I go to the website on Safari browser, but the prices are still the old ones, even if I do a hard-reload (Shift + Reload), and/or click ‘Empty Caches’ under Safari Develop menu
– I go to the site backend admin in Chrome, and click ‘Purge SG Cache’
– Go back to website on Safari, do a simple standard reload, and prices are updated
So clearly there is something missing…
Is that memcache? does sg_cachepress_purge_cache() flush memcache as well?
Is there anything else I should invoke beside sg_cachepress_purge_cache()?
TY in advance for any help
m