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

Purge Cache clears the whole Redis cache, of ALL the users/prefixes... #113

Closed
HansVanEijsden opened this issue Apr 1, 2016 · 10 comments

Comments

Projects
None yet
4 participants
@HansVanEijsden
Copy link

commented Apr 1, 2016

When one of my users installs the Nginx Helper (we even deploy it automatically on every new Wordpress installation) and clicks the Purge Cache button in the admin bar on top, it clears the whole Redis database...
All the page caches of all the users flushed, all the object caches of all the users gone, and Redis completely empty.

Imagine this. A 28GB Redis cache size, 800 users. One of those 800 users presses the Purge Cache button on top, and all the other 799 sites have to warm up the cache again. More than 28GB of cache data gone, every time one of those 800 users presses their button. That's a big problem.

Every site has an own prefix, "example.com:" in the Nginx config and in the Nginx Helper plugin.
I use this config: https://easyengine.io/wordpress-nginx/tutorials/single-site/redis_cache-with-conditional-purging/

Is there a way to make the Nginx Helper only purge "example.com:" from Redis when the user presses Purge Cache, in stead of ""?
And if not, is there an easy way to disable the Purge Cache button?

Thanks!

@Niwreg

This comment has been minimized.

Copy link
Contributor

commented May 24, 2016

I did an https://github.com/rtCamp/nginx-helper/pull/116 pull request that fixes this problem.

@larssn

This comment has been minimized.

Copy link

commented Aug 31, 2016

@Niwreg What happened to this pull request?

@HansVanEijsden

This comment has been minimized.

Copy link
Author

commented Aug 31, 2016

@larssn would love to know that too, I still wait for the merge. Now I have to do all manual, because of the old version in the Wordpress svn.

@larssn

This comment has been minimized.

Copy link

commented Sep 1, 2016

@HansVanEijsden If you're using Redis as your caching layer, I made this fork, which fixes the problem, but only in Redis:
https://github.com/larssn/nginx-helper

It's only lightly tested, but tests so far seem to indicate that it works.

@chandrapatel

This comment has been minimized.

Copy link
Collaborator

commented Sep 1, 2016

Hello @HansVanEijsden @Niwreg

I am sorry for the late response. I have merged the PR and we are doing testing and will release new version soon.

Thanks.

@HansVanEijsden

This comment has been minimized.

Copy link
Author

commented Sep 1, 2016

@larssn nice work. Is it any different from #116 (which was already merged, but also not released yet)?

@larssn

This comment has been minimized.

Copy link

commented Sep 1, 2016

My code is based on the latest master branch.

Looking through the code of #116, it doesn't seem to have fixed what you initially asked. It seems related to WPML and another non-related issue.

For example, my fix makes a multisite running in subfolders work, which the previous version did not take into account.

@HansVanEijsden

This comment has been minimized.

Copy link
Author

commented Sep 1, 2016

@larssn now I see. Great, thanks for all!

@larssn

This comment has been minimized.

Copy link

commented Sep 1, 2016

Made #122

@chandrapatel

This comment has been minimized.

Copy link
Collaborator

commented Sep 2, 2016

Hello @HansVanEijsden

I have released the plugin. Please check. Also I am closing this ticket. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.