• Resolved Vincent Poirier

    (@magikweb)


    Hello,
    We made a “Master flush” button to simplify the different levels of caching.
    It currently flushes WP Rocket and CloudFlare (through its API).

    How can we programmatically flush SiteGround’s SuperCacher programmatically? (Purge SG Cache)

Viewing 12 replies - 1 through 12 (of 12 total)
  • @magikweb,

    According to this article, when you purge WP Rocket’s cache, SG Optimizer’s cache is purged automatically.

    Based on the above, your “Master” flush button should also be flushing SG Optimizer’s cache. If not so, I would contact WP Rocket as well to make sure their current plugin code is current with SG Optimizer’s.

    Cheers!

    Thread Starter Vincent Poirier

    (@magikweb)

    Thank you! We never knew and always cleared both individually. That’s really nice.

    We’ll confirm with WP Rocket just to make sure and move one. ??

    Thread Starter Vincent Poirier

    (@magikweb)

    Marking as resolved.

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @magikweb

    We have a helper function sg_cachepress_purge_cache that you can use to purge the cache.

    Regards,
    Stanimir

    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

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @marco1970

    We will add a new helper function in the next version, which will purge everything(Dynamic cache, Memcached & combined/minified assets ).

    Regards,
    Stanimir

    Hi Stanimir,

    great news, thanks!!!

    Marco1970

    (@marco1970)

    Hi Stanimir,

    did you guys manage to add the new helper function to purge all?

    M

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @marco1970

    Yes, the helper function has been added: sg_cachepress_purge_everything

    You can try it if you have updated to the latest version.

    Your feedback will be highly appreciated.

    Regards,
    Stanimir

    Marco1970

    (@marco1970)

    AWESOME, thanks!!

    will test ASAP and report

    TY

    m

    jetxpert

    (@jetxpert)

    @sstoqnov,

    Thank you for the information. Please clarify:

    (1) What version of SG Optimizer incorporates the new helper function?

    (2) Are you saying that when we click “Purge SG Cache” (WP backend) we are purging static, dynamic, and memcached?

    Again, thank you.

    @marco1970,

    Looking forward to your test results. Also, can you share the process or steps you followed?

    Thank you.

    Is there any inbuilt cron to clear all cache automatically ?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Calling the purge programmatically’ is closed to new replies.