• Resolved Payment Plugins

    (@mrclayton)


    Hi Support Team,

    It is very common when updating a plugin that JS scripts previously cached need to be purged in order for the new code to be cached. This is particularly important when a site admin has enabled the SG option to disable query strings from scripts.

    I have been reviewing the function sg_cachepress_purge_cache and your example on the plugin page but it’s not clear to me how the url to be purged should be formed. For example, is it appropriate to pass in distinct url’s:

    sg_cachepress_purge_cache('https://mywebsite.com/wp-content/plugins/some-plugin/assets/js/payments.js)
    
    sg_cachepress_purge_cache('https://mywebsite.com/wp-content/plugins/some-plugin/assets/js/card-form.js)
    

    Or if you want to purge all scripts associated with a plugin, you pass the parent directory url:

    sg_cachepress_purge_cache('https://mywebsite.com/wp-content/plugins/some-plugin/assets/js/)

    The objective is to clear my plugin’s cached scripts when it’s updated to ensure any changes to the JS take affect immediately. When cached scripts are served after a plugin update, an old reference can cause JS errors.

    Thank you for your time.

    Kind Regards,

Viewing 1 replies (of 1 total)
  • Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @mrclayton

    We have developed smart caching rules that purge the cache on specific WordPress events.

    We flush the cache on plugin/theme/post/comment/term update, so you shouldn’t do anything on your side.

    Regards,
    Stanimir

Viewing 1 replies (of 1 total)
  • The topic ‘Calling sg_cachepress_purge_cache during update’ is closed to new replies.