Skip to content

[CMSP-1033] Preferred method to skip modifying the cache-control #37

@ecaron

Description

@ecaron

We have some situations where other plugins need to manipulate the Cache-Control header for various reasons. However the mu plugin makes that difficult to debug or adjust.

One way this can be handled is with a heavy-handed remove_action call, like this:

remove_action( 'send_headers', array( \Pantheon_Cache::instance(), 'cache_add_headers' ) );

I was wondering if you'd consider adding, within the cache_add_headers method, something like:

if ( do_action( 'skip_pantheon_cache_control') ) {
  return;
}

And then plugin developers could add something like this in their plugin to circument the cache without reaching into the instance.

add_filter( 'skip_pantheon_cache_control', '__return_true' );

If your code standards prefer the remove_action approach, that's fine. I didn't see prior art of it in other Pantheon plugins, so I figured this is a feature you'd consider introducing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions