Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more filters #20

Open
boyska opened this issue Mar 12, 2012 · 3 comments
Open

more filters #20

boyska opened this issue Mar 12, 2012 · 3 comments

Comments

@boyska
Copy link
Contributor

boyska commented Mar 12, 2012

Some sites needs a bit of tweaking to appropriately cache: for example, my site also has a custom feed (url: ?feed=premoderate) which is not purged by wp-varnish.
With a filter, I'll add this to "commonobjects".

I intend to work on this to propose a patch; but I'm asking for opinions here.

@boyska
Copy link
Contributor Author

boyska commented Mar 12, 2012

My proposal is to make a filter for every method like WPVarnishPurgeCommon: the filter will be on the list of "objects" to purge. Example:

<?php
function WPVarnishPurgeCommonObjects() {
    $objects = array('/?', '/feed/', '/feed/atom/', '/category/.*');
    $objects = apply_filters('wpvarnish_purge_commonobjects', $objects);
    foreach( $objects as $o)
        $this->WPVarnishPurgeObject($o);
}
?>

so my site can easily add an object to this array, purging what I need

@pkhamre
Copy link
Owner

pkhamre commented Mar 13, 2012

Sounds like a good idea.

@cd34
Copy link
Collaborator

cd34 commented Jan 31, 2013

Right now, you could just add:

$this->WPVarnishPurgeObject("/?");

to the function.

I'm rather hesitant to hardcode something like this as even category, feed, etc could be in subdirectories, or, with different permalink structures, could be named differently. I think the base URLs need to be constructed taking some of the WordPress helpers into account and then perhaps an optional purge list could be added through the admin. That would allow for much better handling of various site configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants