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 a single site in subfolder multisite setups #122

Closed
wants to merge 13 commits into from
Closed

Purge a single site in subfolder multisite setups #122

wants to merge 13 commits into from

Conversation

larssn
Copy link

@larssn larssn commented Sep 1, 2016

  • Purging a single site in a subfolder multisite setup now works.
  • Minor code cleanup.

If your domain is setup as www.example.com/site1/, www.example.com/site2/ etc., then pressing the "Purge Cache" button on one of those sites will now only purge the cache for that site. Tested and working.

Same should be true for subdomain multisite setups.

Ps. Don't merge the readme file.

chandrapatel added a commit that referenced this pull request Sep 2, 2016
@chandrapatel
Copy link
Contributor

Hello @larssn

Thanks for the PR. I applied different solution to purge single site cache in multisite setup. It's work for both sub-domain and sub-directory site. Please check my commit c4dc90d

I haven't merge this PR as it contain more changes and for the main issue I applied different solution.

Please let me know your wordpress.org username so I can add in contributors list.

Thanks again.

@chandrapatel
Copy link
Contributor

Hello @larssn

I have released the plugin. Please check. Thanks for your help.

@larssn
Copy link
Author

larssn commented Sep 2, 2016

Cool, it looks like that would purge correctly. Gonna test it.

Ps. I use nuvoPoint (my company) as my username.

@larssn
Copy link
Author

larssn commented Sep 2, 2016

So there's still an issue if you're using domain mapping:
When standing on the network admin page, and pressing purge cache it deletes the cache of all sites - a function that i'd prefer the big red button doing, under settings.

Lemme explain. So if Redis contains this:

  1. "nuvoweb-cache:httpsGETwww.asia-slagelse.dk/"
  2. "nuvoweb-cache:httpsGETcloud.nuvoweb.dk/"
  3. "nuvoweb-cache:httpsGETcloud.nuvoweb.dk/ye-sushi/cart/"
  4. "nuvoweb-cache:httpsGETcloud.nuvoweb.dk/ye-sushi/produkt/"
  5. "nuvoweb-cache:httpGETwww.onekey.dk/"
  6. "nuvoweb-cache:httpGETnuvoweb.dk/"

.. and I'm standing in the network admin page at cloud.nuvoweb.dk/network, and press "Purge Cache", then the entire cache is deleted, including onekey and asia, which are different domains.

It should optimally look like this afterwards:

  1. "nuvoweb-cache:httpsGETwww.asia-slagelse.dk/"
  2. "nuvoweb-cache:httpGETwww.onekey.dk/"
  3. "nuvoweb-cache:httpGETnuvoweb.dk/"

I had fixed this in this pull request, by adding a new helper action called "site", that only purges the cache for a single domain.

@chandrapatel
Copy link
Contributor

Hello @larssn

The interface might be confusing.

If you Purge Cache from Network Admin then it will purge all site cache in WPMU.

If you want to purge cache of individual site then goto the individual site dashboard and click on Purge Cache button.

Let me know if this make sense.

Regards,

@larssn
Copy link
Author

larssn commented Sep 2, 2016

Yeah I get it, maybe my example didn't make sense.
Anyway, your code, your choice. My fork needs to do it my way though. :)

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.

2 participants