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

Conversation

@stayallive
Copy link
Contributor

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 stayallive force-pushed the stayallive:feature/custom-purge-url branch from 30dd6a0 to 959df44 Apr 17, 2018
stayallive added 2 commits Oct 30, 2018
鈥-url

# Conflicts:
#	purger.php
@stayallive

This comment has been minimized.

Copy link
Contributor Author

stayallive commented Jan 7, 2019

Rebased for 2.x.

@stayallive

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Collaborator

chandrapatel commented Mar 12, 2019

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

Copy link
Collaborator

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 added 2 commits Dec 19, 2019
@stayallive stayallive requested a review from chandrapatel Dec 19, 2019
@chandrapatel

This comment has been minimized.

Copy link
Collaborator

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
1 check passed
WIP Ready for review
Details
@stayallive

This comment has been minimized.

Copy link
Contributor Author

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 stayallive:feature/custom-purge-url branch Dec 19, 2019
@thrijith thrijith mentioned this pull request Jan 3, 2020
@HansVanEijsden

This comment has been minimized.

Copy link

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
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.