• Resolved Rob de Cleen

    (@rdc2701)


    Hi,

    First of all, thank you for the great performance with W3TC!

    I have a translations/cache related question:
    I work with Falang to make the site multilanguage, and that works fine, also together with W3TC (https://www.ads-software.com/plugins/falang/)

    There is one issue which I need some help and advice with:

    Purging single items (post/page/custom-post-type) works great in the default language, but it does not clear the translated versions from the cache. These updated translated versions only show up after a complete cache purge, which is obviously not so practical (or somewhat counterproductive).

    I am already in contact with the Falang developer. Is there any advice you can give him as to what he needs to implement in his code to get single-item-purge-from-cache also working on the translated items (so not just default language)? Falang stores the translations data in in the meta key fields, example for content in FR:
    _fr_FR_post_content, _fr_FR_post_title.

    Thanks in advance for your help and advice,

    Rob

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

    (@vmarko)

    Hello @rdc2701

    Thank you for reaching out and I am happy to assist you with this.
    One thing you can try is to enable Cache alias hostnames: in Performance>Page Cahce>Aliases.
    So if you are serving the same content from a different URL you can add for example:
    https://yourwebsite.com
    https://yourwebsite.com/fr/
    https://yourwebsite.com/gr/
    https://yourwebsite.com/es/

    Make sure to save all settings and purge the cache.
    Let me know if this helps!
    Thanks!

    Thread Starter Rob de Cleen

    (@rdc2701)

    Hi Marko,

    Thanks for the quick answer. Indeed that works just fine, now multiple languages for each item get nicely purged from the cache.

    It was my misunderstanding for not trying this option, I originally thought it was only valid when you actually had different domains/installations for each language. Whereas this is the same domain with a different /xx for language, so different URL. So I just skipped trying it before ??

    You solution seems to be working fine on the test site. I will try it out on the live website later and let you know.

    Thanks and have a nice day!

    Rob

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rdc2701

    Thank you for your feedback.
    I am glad I was able to help and that everything works as expected.
    Thank you!

    Thread Starter Rob de Cleen

    (@rdc2701)

    Sorry, I was a little too hasty, the test site behaved differently because of the password protected plugin.

    Unfortunately the live website still has the same issue:
    default language > change something > single item purge > all OK, refreshed content
    secondary language> change something > single item purge > no changes, cached version persist. The same happens even when I save the changed 2nd language, then save the primary language, then purge the cache for the single item. No change is shown.
    Only a purge all caches makes the changes in the 2nd language show up.

    So it’s not resolved, I still need help with this ??

    Rob

    Thread Starter Rob de Cleen

    (@rdc2701)

    Hi,

    I did some more testing and have enabled aliases on both live and dev websites equally:

    > Page Cache > Aliases
    – Enabled: checked
    – Aliases http(s)://example.com/
    and http(s)://example.com/it/
    etc.

    DEV site:
    Here purge-single-item also works for translations changes.

    LIVE site:
    Here purge-single-item does not work for translations. Only purge all caches shows the change.

    On both dev and live the message appears:

    The setting change(s) made either invalidate the cached data or modify the behavior of the site. [Empty the Page Cache] now to provide a consistent user experience.

    [Empty the Page Cache] in that bar works on dev, not on live (no visible reaction).
    On live I need to use Purge Modules > Page Cache, or Purge All Caches.
    After that the change in the translation does show of course.

    The only differences between live and dev as far as I can tell are:
    – live website has www to non-www redirect (htaccess)
    – live website has http to https redirect (htaccess)
    – live website has https, dev site does not

    Do you have any idea why the difference in behaviour could happen?

    Thanks for looking into this (again),

    Rob

    • This reply was modified 3 years ago by Rob de Cleen. Reason: typo
    Thread Starter Rob de Cleen

    (@rdc2701)

    Hi,

    Corrected result: all is working fine with the aliases fix you proposed.

    Seems I had been too impatient before, testing the changes in the translated version before the cache was completely preloaded ?? So my previously reported results were nonsense, sorry.

    Once I have a warm cache (I had to make some adapations to my cache warming setup) the “purge single post item” works fine for showing the changes on the translation. Works fine both on the live website and the dev site.

    Thanks again for your patience and support!
    Rob

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rdc2701

    Thank you for the confirmation and I am glad everything is working as expected.
    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Single item purge from cache and translations with Falang’ is closed to new replies.