Hello,

Our client needed a module that would flush the page cache for an alias both from the node edit page (on save) and also from the publish page (in this case we're using Revisioning).

They also needed the ability to flush the page cache across all pages all translations of the node.

Rather than branching this module off, we opted to create a patch to see if these might be useful features to have in the module.

Installation: To enable the functionality, you need to go to the Content Type Settings edit page and enable this for the content types you want it on.

Please see attached!

CommentFileSizeAuthor
clear_cache_on_page_save.patch6.6 KBcaseyc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

codesmith’s picture

+1 for this idea. Maintainers - what do you think?

iamEAP’s picture

While this is behavior that I would definitely personally benefit from, and I do appreciate the patch, I'm not sure this module is the right place for it.

I believe similar behavior is possible with the Cache Actions module, and if it's not, it would probably be an appropriate feature request/patch as a provided action (at least the cache clear for all translations part).

At the very least, it might be appropriate to introduce a hook (like hook_flush_page_cache_flush_cache($url) or something) so you could use some of this code in a custom/utility module.

In any event, apologies for the delayed response.

codesmith’s picture

I got around to applying this patch and it works great! One thing - around line 328 (after applying the patch)

  if ($form_state['values']['flush_page_cache_clear_all_domains']) {

I think should be

  if (isset($form_state['values']['flush_page_cache_clear_all_domains'])) {

to avoid "Notice: Undefined index: flush_page_cache_clear_all_domains in flush_page_cache_clear_on_page_save_submit() (line 328 "

I looked at Cache Actions module and it doesn't seem to support this behavior. I think this would be a great addition to this module.

Greg Boggs’s picture

Issue summary: View changes
Status: Active » Needs review

This would solve a cache issue I'm having with revisioning. Has this feature been implemented?

wizonesolutions’s picture

No, the maintainer was against it as-is. But it seems he would accept a patch that added a hook to enable other modules to do step in and do other things.

So we've been using our patched version with great success for months.