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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using filters to change the purge url #141

Merged
merged 5 commits into from Dec 19, 2019
Merged

Allow using filters to change the purge url #141

merged 5 commits into from Dec 19, 2019

Conversation

stayallive
Copy link
Contributor

@stayallive stayallive commented Jul 10, 2017

This allows the user to do 2 things.

  1. Change the /purge suffix that nginx uses by default:
add_filter('rt_nginx_helper_purge_url_path', function () {
    return 'custompurgepath';
});
  1. Allow changing the full purge url / domain + suffix at once:
add_filter('rt_nginx_helper_purge_url_base', function () {
    return 'https://custompurgedomain.com/purge';
});

Why both filters? When working with nginx-helper I noticed I often have to change nginx paths algorithm to comply with custom scripting or server changes on our side.
The second filter helps when even the full purge url is different, because of internal networking. Although this happens seldom, the filter helps to mitigate these issues.

Would be great to be able to override it this way instead of hard-coding the changes in 馃憤

@stayallive
Copy link
Contributor Author

@stayallive stayallive commented Jan 7, 2019

Rebased for 2.x.

@stayallive
Copy link
Contributor Author

@stayallive stayallive commented Mar 12, 2019

It would be very appreciated if this can be looked at and/or be rejected if this is not something that you are willing to accept 馃憤

@chandrapatel
Copy link
Collaborator

@chandrapatel chandrapatel commented Mar 12, 2019

Hi @stayallive We will discuss internally and will let you know. Thanks for the PR.

Copy link
Collaborator

@chandrapatel chandrapatel left a comment

@stayallive My apologies to review PR very late.

I have left few comments on PR. Please check and let me know your thought.

Also please update your PR by merging latest changes from master branch to your branch.

Thanks,

admin/class-fastcgi-purger.php Outdated Show resolved Hide resolved
admin/class-fastcgi-purger.php Outdated Show resolved Hide resolved
admin/class-fastcgi-purger.php Outdated Show resolved Hide resolved
admin/class-fastcgi-purger.php Outdated Show resolved Hide resolved
@stayallive stayallive requested a review from chandrapatel Dec 19, 2019
@chandrapatel
Copy link
Collaborator

@chandrapatel chandrapatel commented Dec 19, 2019

@stayallive Thanks for quickly work on the PR.

@chandrapatel chandrapatel merged commit 9d0ba4f into rtCamp:master Dec 19, 2019
1 check passed
@stayallive
Copy link
Contributor Author

@stayallive stayallive commented Dec 19, 2019

No problem happy to see it being accepted, this will make plugin updates in the future a lot easier for us :) Thanks!

@stayallive stayallive deleted the feature/custom-purge-url branch Dec 19, 2019
@thrijith thrijith mentioned this pull request Jan 3, 2020
@HansVanEijsden
Copy link

@HansVanEijsden HansVanEijsden commented Jan 6, 2020

@stayallive @chandrapatel thank you very much! 馃憤馃徎

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

Successfully merging this pull request may close these issues.

None yet

3 participants