Wp-rocket: Cache lifespan cannot be set below 10 minutes

Created on 18 Dec 2019  Â·  14Comments  Â·  Source: wp-media/wp-rocket

Not sure when or why we started restricting the Cache lifespan lowest value to 10 minutes. Please see this - https://jmp.sh/f4wUXqC

  • This is poor user experience as there is no feedback or instruction for the user.
  • If we want to limit this, we should use min for the input and set it to 10. (But then we need to let customers choose 1 hour, so this will be complicated.)
  • This also affects setting the cache lifespan to 0 (for infinite) when the duration is minutes. i.e. if a customer sets cache lifespan to 0 minutes, it's reset to 10 minutes, thus defeating our own instruction in the UI.

My recommendation:

Remove this restriction and let the customer choose what they want. If they want to clear the cache every 5 minutes, let them.

wontfix

Most helpful comment

@GeekPress Can we also make sure that 0 minutes = unlimited?

Sure!

All 14 comments

I'm totally agree about the lack of user experience here.

If they want to clear the cache every 5 minutes, let them.

But I can't be agree with that. It's a "decision, not option" here.

We have no reason to let a customer doing that. A cache cleared each 5 minutes, it's like never having cache. WP Rocket is just totally useless here.

If for an edge case a user needs to do that, then WP Rocket isn't the good tool for his needs.

By allowing to do this, we are giving a way to our users to do bad things, and to have a bad experience with WP Rocket.

By the way I will personally don't allow a cache lifetime value less than 1 hour.

We have no reason to let a customer doing that.

We don't know every use case that the customer is going to use our product in. If we didn't have the option for minutes and just have the hours, I would totally be on-board with you here. The lowest setting would be an hour.

But since we already have the UI for minutes and we know that some customers use them, it doesn't make sense to have a restriction. Cache cleared at 10 minutes is still bad based on your argument.

It's just an unnecessary complication.

For context, this minimum was added during version 2.10, around May 2017, as part of various UI improvements we did on that version. So more than 2 years ago.

I agree with Jonathan that the restriction should not be removed. Having anything under 10 minutes doesn't make much sense.

It can also put unnecessary strain on the server, as the calls to clean the cache would be too frequent. That was especially true before when the clean lifespan was calling for a full clear cache each time. Less of an issue since 3.4, but still.

We can add an UI feedback to the notice after saving if needed. How many feedbacks on this particular case did we get since we introduced the change?

We don't know every use case that the customer is going to use our product in.

In fact, we don't really care about why a user will need to have the cache cleared each 5 minutes.

The fact is: it's totally useless.

If you need to clear your cache each 10 minutes, WP Rocket isn't the plugin you need to improve your loading time.

If we didn't have the option for minutes and just have the hours, I would totally be on-board with you here.

It's not because an option is here now, it means we have to keep it forever. We removed options a couple of times already.

Please note that only 1.62% of our users are using the Minutes value (data from Mixpanel).

We can add an UI feedback to the notice after saving if needed. How many feedbacks on this particular case did we get since we introduced the change?

This issue was not based on any customer feedback. It just didn't make sense to me to restrict the last 10 minutes.

We could simply add this to the UI. Lucy suggested adding a 10 minute minimum in the help text. Like so:

10 min

Apart from this, we definitely need to fix the issue where customers cannot set it to 0 minutes for infinite caching.

we definitely need to fix the issue where customers cannot set it to 0 minutes for infinite caching.

Big upvote for this because for customers that previously had it set to 0 minutes, in order to turn it off, it's now defaulted to 10 minutes 😱

https://secure.helpscout.net/conversation/1039832731/137945?folderId=377611#thread-2938275811

one other thing I observed is cache lifespan is defaulted to 10 minutes.. My original setting was 0 minutes.. now I am not able to change it to 0 minutes..

You can set it to 0 for Hours or Days, however for Minutes this is restricted to a minimum of 10 Minutes.
So the restriction apply only to Minutes.

You can set it to 0 for Hours or Days, however for Minutes this is restricted to a minimum of 10 Minutes.
So the restriction apply only to Minutes.

This is right, but the user doesn't know this. When we fix this, we can fix for minutes as well. Can be fixed by a simple modification here: https://github.com/wp-media/wp-rocket/blob/4b8b155c0a3c5543f70867a4b26725e1dbd8457e/inc/classes/admin/settings/class-settings.php#L240-L243

To move forward on this problem, let's do a mix:

  • keep the 10 minutes restriction
  • Lucy suggested adding a 10 minute minimum in the help text (ref => https://user-images.githubusercontent.com/5751474/71124602-322cc180-220b-11ea-8996-608c8b71bcdf.png)

@wp-media/wprocketplugin The grooming will have to be estimated from this comment: https://github.com/wp-media/wp-rocket/issues/2202#issuecomment-629127026

@GeekPress Can we also make sure that 0 minutes = unlimited?

@GeekPress Can we also make sure that 0 minutes = unlimited?

Sure!

Reproduce the issue ✅
Identified the issue on localhost.

Identify the root cause ✅
https://github.com/wp-media/wp-rocket/blob/0aa1fd37f2df21ecbc5ca63bfae4964991431473/inc/Engine/Admin/Settings/Settings.php#L262-L265

Scope a solution ✅
Allow to set the lifespan to 0 when MINUTES is selected.
Lucy suggested adding a 10 minute minimum in the help text (ref => https://user-images.githubusercontent.com/5751474/71124602-322cc180-220b-11ea-8996-608c8b71bcdf.png)

Effort ✅
Effort [S]
Tests need to be updated

Closing this issue as we removed the minutes value from the cache lifespan option.

Was this page helpful?
0 / 5 - 0 ratings