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
Closed

Comments

@HansVanEijsden
Copy link

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
Copy link
Contributor

Niwreg commented May 24, 2016

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

@larssn
Copy link

larssn commented Aug 31, 2016

@Niwreg What happened to this pull request?

@HansVanEijsden
Copy link
Author

@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
Copy link

larssn 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
Copy link
Contributor

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
Copy link
Author

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

@larssn
Copy link

larssn 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
Copy link
Author

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

@larssn
Copy link

larssn commented Sep 1, 2016

Made #122

@chandrapatel
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants