
On Thu, 2025-06-26 at 18:36 -0700, Mark Sapiro wrote:
You can delete the cached entry from the database via `mailman shell as in
>>> cm = getUtility(ICacheManager) >>> uri = 'the_uri_from_the_template_table' >>> cm.get(uri, expunge=True) >>> commit()
You can also delete the entry from the file_cache table, but if you do that, the actual file containing the cached data will remain. To remove it, Rather than doing any of the above, if you want to manipulate the database, just set the expires_on column in the file_cache table entry to a date in the past.
Hi Mark,
Thank you for this information. I've given the options a good workout over the last couple of days and found that:
Deleting the cache via the mailman shell does the job, but is beyond me to script. There are numerous lists and list owners updating their templates.
Changing the expires_on date (to a date in the past) in the file_cache table didn't prevent the cached entry from being used;
What did work was removing the records in the file_cache table PLUS removing the corresponding files in var/cache/*/*/* -- for example: /opt/mailman/mm/var/cache/3a/2f/*
This I was able to script in bash and cron to run every minute.
A hack I know, but it's working for now.
I've attached the script in case it's of use to anyone else. (mailman_clear_template_cache.txt) Note: change <USER> in the script to what suits.
Does Mailman really need to cache the templates? It seems to be an unnecessary complication.
Anyways it happy days again. Thank you again, very much. Your guidance was appreciated immensely as always.
Best, Mark