• Resolved tangurin

    (@tangurin)


    Hello,

    I want to call “w3tc_flush_url()” to flush an url. Do I need do something more? What I can see, the w3tc_flush_url(), are only adding the url to a queue array: “$this->queued_urls”

    The main problem is that the term’s pages at the frontend are not purged when I save the post. Even if the “Purge Policy: Page Cache” has the setting “Post terms pages” checked. Maybe it is because The wp-admin and the frontend is at different url’s?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tangurin

    Thank you for reaching out and I am happy to assist you with this.

    Have you tried adding those pages to Performance>Page Cache>Purge Policy>Additional pages: and Specify additional pages to purge?

    To purge them programmatically, you can call w3tc_flush_url($url) on those posts.

    Thanks!

    Thread Starter tangurin

    (@tangurin)

    Hello @vmarko

    I need to do it dynamically with code, else I need to add a url everytime the terms are changed/added.

    The problem is that I want to add the term url’s when a post i saved: “add_action( ‘save_post’)
    But then the cache is already purged, and that’s why I can’t queue the urls with flush_url function.

    <span style=”text-decoration: underline;”>To be clear:</span>

    Problem:

    1. When a post is saved, the cache on the term landing pages is not purged
    2. “Purge Policy: Page Cache” -> “Post terms pages” is checked
    3. Maybe the problem is because the url to our website’s admin and the frontend is different? It is purging cache for the admin url and not the frontend? (I don’t know how the purge is working)

    What I am trying to do to solve it:

    1. I have an add_action for “save_post”
    2. When a post i saved, I want to add the url’s to the “w3tc_flush_url”, but this doesn’t work because the url’s array are already flushed when the “save_post” is triggered.

    Thread Starter tangurin

    (@tangurin)

    Or maybe the question is this simple. Why isn’t the term page cache purged when saving a post?

    It works locally but not in production at the server.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tangurin

    IS there any chance you can share the website URL and the URL of the page that is not purged?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Purge cache for an URL programmatically’ is closed to new replies.