-
Notifications
You must be signed in to change notification settings - Fork 36
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
Comments
My proposal is to make a filter for every method like <?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 |
Sounds like a good idea. |
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. |
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.
The text was updated successfully, but these errors were encountered: