I am running into some issues with memcached, so I am wondering if anyone else has had a similar experience? Sometimes content doesn’t update on the site for significant amounts of time – sometimes an hour, it feels like. But if we restart memcached, suddenly the update is present. Is there a setting we could have wrong that prevents it from being properly purged when a template is changed or new content added?
This might be more of a support question, of course, but I figured I’d check to see if the answer is out there somewhere first.
A page that had this issue was http://www.westeros.org/GoT/News.
The template for that is set to Yes for caching, and 60 minutes time.
In Template Preferences, we have “Do Not Change”. I’m guessing setting that to ‘No’ would override caching settings for all individual templates?
I don’t use any tag caching or caching add-ons. 3rd party caching on the server itself includes Cloudflare (but the issue persists if we go into Development mode), Varnish (however, we pass straight through Varnish so do not use it for caching), and memcache (which seems related to the issue)
Update: I just spun up a matching scenario to what you described, and caches are being cleared as expected when I publish a new entry, and have “Clear cache for new entries?” enabled. Can you reproduce the problem in a separate install/domain that is not proxied by Varnish, CloudFlare, or any other means?
Hrm, its complicated. We have a wiki and a forum on the server as well and taking out Varnish entirely would be a large interruption.
We’ll check if there’s any way we can test it on our secondary server, but I don’t know off the top of my head if that has Varnish too (we don’t do the setup ourselves, we have a friend who manages it).
Thank you so much, though, for looking into this.
Yeah, don’t start pulling things off of production, for a true isolated test, a fresh environment would be needed anyway. I’m just not seeing where it would be failing. Memcached holds its values for the entire length of the expiration, but we when a cache clear event is triggered, we stop referencing the original keys, and start with a new namespace.
What is involved in a clear cache event? Does it do anything different to clear memcached compared to when it expires according to the template settings? Because as far as I can tell, the cache does clear on the 60 minute timeout.
Could it be making use of different permissions, somehow? We have had an issue in general with EE where files created by EE are owned by apache rather than our user account, and then we end up not being able to clear them manually.
Memcached is all in-memory, so there aren’t any permissions involved, and the caching drivers all use the same core code, so respond to the same clearing events. Memcached cannot flush contents using a wildcard pattern with its keys, and could be storing on multiple servers, so when a cache clear is triggered, we spin up a new namespace and ignore the others. Those old ones will persist in memory until their expiry, but ExpressionEngine no longer references the old keys, essentially having “forgotten” them.
Can you share your memcached
config? Both in your config.php
file and Memcached’s config itself, please.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.