Laravel-Backpack / Settings

Application settings interface for Backpack (for Laravel 6).
http://backpackforlaravel.com
Other
248 stars 78 forks source link

[Feature] Cache settings #91

Open dkwiebe opened 4 years ago

dkwiebe commented 4 years ago

Add support to SettingsServiceProvider.php to cache settings using the Laravel cache. This slightly improves our performance by storing all the settings in whichever cache we use. For high traffic sites this saves a lot of database access.

welcome[bot] commented 4 years ago

BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly.

Please keep in mind that:

Thank you!

-- Justin Case The Backpack Robot

tabacitu commented 4 years ago

Thank you for the PR @dkwiebe ! I agree - I see no reason why we shouldn't cache the settings, and prevent all those queries on page load.

One thing popped up when looking over your PR (metioned it here too https://github.com/Laravel-Backpack/Settings/issues/90#issuecomment-565978500): I think we also need to refresh the cache when a Setting is edited, so that the new value is instantly available. Otherwise I think the Admin will go edit a setting, see the new value in the admin panel, but not understand why that new value is not used on his website. Right?

marechenok commented 2 years ago

Waiting this feature in new version!