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

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

Rebased for 2.x.

@stayallive
Copy link
Contributor Author

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
Contributor

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

Copy link
Contributor

@chandrapatel chandrapatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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,

@chandrapatel
Copy link
Contributor

@stayallive Thanks for quickly work on the PR.

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

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 December 19, 2019 08:28
@thrijith thrijith mentioned this pull request Jan 3, 2020
@HansVanEijsden
Copy link

@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.

3 participants