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

Add cache level setting to lower number of cache purges on high performance websites #478

Open
foliovision opened this Issue Jul 21, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@foliovision
Contributor

foliovision commented Jul 21, 2017

We run a website which gets 1 million pageviews every day and even 800,000 pageviews in a single hour during peak traffic. We choosed not to use Varnish but WP Rocket as we expected we will be able to debug or tweak its behavior better. It turned out to be just that - we are able to tweak WP Rocket behavior and we are thankful for that, but here is what we found and believe should be improved -

WP Rocket does way too many cache purges:

  1. Feeds are no longer cached by WP Rocket since version 2.10.5 - this is a disappointment. Now we have to use some addon plugin to make sure the feeds are cached.

  2. Full page cache is purged on user registration or user profile update - the last thing you need on a high performance website (as the server load just goes up when somebody registers). So we had to use the code from here to stop these action from triggering rocket_clean_domain(): http://docs.wp-rocket.me/article/137-disable-all-automatic-cache-clearing

  3. New comments to post also clear homepage and archive cache - this is to show accurate comment numbers, but in our case there is a new post or a post update every 15 minutes, so sooner or later these numbers are correct.

  4. When post cache is cleared using rocket_clean_post() it also clears cache for:

  • next post
  • next post in same category
  • previous post
  • previous post in same category

I see it might make sense for some websites and to keep the next post link working. However wouldn't it be enough to do this when the post is first published or deleted only? Because currently when there is a new comment to the post, rocket_clean_post() is called and it clears all the adjacent posts as well.


While I see that your aim is to work well for 260k websites you should not forget about the high performance websites. I posted some emails to Caspar and it seems you want to keep your settings screens as simple as possible with few options available. So to provide some control over that cache level our suggestion would be for your to add caching presets like this:

  • Normal (current plugin behavior)
  • High (make sure feeds are cached (1) and (2) is automatically disabled along with (3) and (4))

I think such control would be very nice and make your plugin much more useful.

There could also be "Extreme" option which you limit the amount of cache purges done per minute by implementing some cache purge queue. Currenlty when our website gets 1 comment every 10 seconds, the homepage cache is cleared again and again (and the adjacent posts), so the server load is really an issue.

Thank you,
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment