Support » Plugin: Optimum Gravatar Cache » W3TC support

  • ResolvedPlugin Contributor Will Stocks

    (@willstockstech)


    Per discussion, support for W3TC would be beneficial, as W3TC is one of the (if not the) biggest caching plugins on WP (over 1m installs).

    I’m adding the following to my install:

    case 'w3-total-cache':
    	foreach ($postsIDsToClear as $postIDToClear) {
    		w3tc_flush_post((int)$postIDToClear);
    		w3tc_cdn_purge_files(); //Pass rray consisting of uri paths (i.e /wp-content/uploads/optimum-gravatar-cache/avatar/2.jpg)
    	}
    break;

    and

    if (defined('W3TC')) {
    	$this->cachePagePlugins='w3-total-cache';
    	return;
    }

    Using the w3tc_cdn_purge_files(); function is to be confirmed, based on: https://wordpress.org/support/topic/api-documentation-6/#post-11170484 – you likely do not want to “purge” a file, it’s probably more appropriate to “invalidate” a URI?

Viewing 15 replies - 1 through 15 (of 33 total)
  • Plugin Author José Miguel

    (@jomisica)

    Hello @willstockstech,

    I’ll have to analyze.

    However w3tc_cdn_purge_files should work with most of the w3’s CDNs or all.

    It must be a way that works for any CDN configured in w3.

    Plugin Author José Miguel

    (@jomisica)

    Hello @willstockstech

    To be clear, a lot will change in version 2.

    .Support for multisite.
    .the names of the gravatars will be hashs representing the content. This way, when you change the content, it automatically changes the name. This will no longer need to invalidate url in CDNs, Cloudflare, etc.

    So the support for w3 CDN is only up to version 2.

    Plugin Contributor Will Stocks

    (@willstockstech)

    Hey @jomisica
    Yes, it seems w3tc_cdn_purge_files might be a good catch all for any of their CDN integrations, not just S3/CloudFront. Some investigation might be necessary – I’m happy to spin up a staging version of my site for testing if that would help?

    Plugin Contributor Will Stocks

    (@willstockstech)

    Ahhh, that’s great! Version 2 is sounding good! Hashes as the file name would definitely alleviate having to invalidate URLs (long run, also a money saver as AWS charges for > 1000 invalidations)

    Plugin Author José Miguel

    (@jomisica)

    Hello @willstockstech

    Does version 1.4.4 work well with W3TC?

    Plugin Contributor Will Stocks

    (@willstockstech)

    hi @jomisica – I have just updated my Gravatar now, so I’m going to see how things are tomorrow in terms of “auto cache clearing” 🙂

    Plugin Contributor Will Stocks

    (@willstockstech)

    Looks like it has worked! I updated my Gravatar last night, have just checked my site now and can see that my latest Gravatar is showing on my site (I haven’t logged in or manually cleared my cache at all!)

    That’s great, thank you @jomisica 😀

    Plugin Author José Miguel

    (@jomisica)

    Great @willstockstech , I’ll then release version 1.4.4 for others using W3TC.

    Thank you!

    Plugin Author José Miguel

    (@jomisica)

    I do not want to discourage you @willstockstech, but I only see the new image in the posts.

    Plugin Author José Miguel

    (@jomisica)

    @willstockstech

    Do you have the option to clear the front page when a post is created enabled?

    Plugin Contributor Will Stocks

    (@willstockstech)

    Hey @jomisica – how weird, when I checked on my desktop earlier, it was all good! Then again, I cleared browser cache to check.

    When I check on mobile _none_ of them have changed!

    When I check on another laptop, only my homepage has changed (in post is still old).

    I think, what I’m going to do, is take Cloudfront out of the equation and serve the Gravatars from my server. That way I’m not adding Cloudfront caching to the mix.

    Yes, I have that option enabled in W3TC, however I wonder whether that only fires on new content being published? Maybe it’s not part of the “page cache clear” process?

    Let me remove my CDN from the mix and get back to you?

    Plugin Author José Miguel

    (@jomisica)

    Hello @willstockstech

    Can you check at least if the images have been synced to the CDN?

    Plugin Contributor Will Stocks

    (@willstockstech)

    I will check – in theory they should have as W3TC does it regularly via cron.

    https://willstocks.co.uk/wp-content/uploads/optimum-gravatar-cache/avatar/7.jpg?d=timxem

    vs

    https://cdn.willstocks.com/wp-content/uploads/optimum-gravatar-cache/avatar/7.jpg?d=timxem

    Server appears to have new, CDN has old 🙁

    I think it’s best I remove the CDN for the time being?

    Plugin Author José Miguel

    (@jomisica)

    @willstockstech

    Do you use WP Cron or linux cron?

    Plugin Contributor Will Stocks

    (@willstockstech)

    WP-Cron but via https://cron-job.org/ (at the moment, on a every 2 minute schedule

    Linux cron wouldn’t work for me for some reason a the command just wouldn’t execute, or if it did it would only partially complete and then things would just queue

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘W3TC support’ is closed to new replies.