How to Clear W3TC Page Cache on Other Server on Master-Master Replication?

Discussion in 'ISPConfig 3 Priority Support' started by jaypabs, Jul 6, 2022.

  1. jaypabs

    jaypabs Member

    I have a plugin that generate a short code to update the content of an article. Every 11:00 AM, 2:00 PM and 5:00 PM, this short code value is changed.

    This is how it looks on my article when editing:

    Code:
    Student ID: [student id = 165671]
    This id 165671 can be updated in the database with value 01-01-10 or the like, so when the visitor view the article, it would look like this:

    Instead of a short code.

    I don't have problem with this when I only have one server, but now since I added another server as a mirror on my first server, whenever I edit the other server like server1, server2 article is not updating due to page caching of W3TC.

    Is there any workaround on this to tell the other server that I have updated the other server? I can see that both databases are replicating (i.e. the value of short code was updated on other server) except that the page cache of W3TC is not cleared on the other server.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    This is surely not the best place to ask about W3TC specific issues, but in general what you would do depends on how W3TC stores it's page cache and how you have your servers "mirrored" (your issue has nothing to do with ISPConfig or server mirroring within ISPConfig). Assuming it just stores files in the filesystem and your web server serves those directly rather than querying php for page contents, it should suffice to have the filesystem of your website mirrored/shared between the two servers, so when the cached file is updated on one it is automatically updated on the other. I would have expected that to be part of your "mirroring" setup already, but maybe it is not, or perhaps W3TC is not caching to the filesystem.
     
  3. jaypabs

    jaypabs Member

    I forgot to mention that I am using memcached for page caching. So that is my problem. This would be easy if I use disk caching.
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Memcached is perfect for that use case, it is probably easier than filesystem mirroring.
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I'm probably confusing redis with memcached here. Looks like for memcached you configure the client (w3tc) to perform redundancy (and I didn't check to see if w3tc can do that or not), or you can look at http://repcached.lab.klab.org/
     

Share This Page