@sr57 As of my understanding, the is no risk to delete your data once run the cache:clear. You can do it.
Cache clear in production?
Any risk to do php artisan cache:clear in production?
Some user's troubles are not a risk for me if data cannot be lost/damaged.
Thanks, wait to see if other comment(s) before select best answer.
The only affect it will have is that the first request will take a tiny bit longer.
Thanks, normal and not a risk.
Cache your data for a few hours, it means don't use rememberForever.
For example
$users = Cache::remember('users', now()->addHours(12), function () {
return User::all();
});
For next 12 hours it doesn't touch data from a database. After that time it will be again retireved from the database a cached.
When your run php artisan cache:clear it just remove all cached data, but they will be again retrieved and cached from database. It's normal when want to refresh all data on your app at the same time.
Thanks for your reply.
For next 12 hours it doesn't touch data from a database.
Ok, can be useful sometimes, I have to test later.
No possibility to select the period, let's say for instance to transfer to/from the db only during the night?
It doesn't matter. Who first visit your page then it will be cached for the next 12 hours in this case.
It could be 5 minutes. It's up to you.
now()->addMinutes(5)
Thanks I did not understand it's per user.
It's not per user.
THANKS, I have to test to better understand ... later.
Please or to participate in this conversation.