In tracker mode plugin system settings should be automatically cached #6728
Labels
c: Platform
For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
If a plugin uses the Settings API and uses it in Tracker mode we always query the database to get the values causing many database queries and a lot of overhead. A plugin developer is most likely not aware of such side effects. Even if someone is aware of this one still has to write a lot of code to cache the setting values and one has to know about events, about cache class etc, one has to write many tests see and one has to invalidate the tracker cache manually. Example of such a class: http://pastebin.com/fXBRpFSR . Therefore we should handle this case automatically as part of the platform.
UserSettings
are most likely never accessed in Tracker mode as it does not really make sense. To keep the cache small we should only cacheSystemSettings
automatically. We should also automatically invalidate the tracker cache as soon as someone changes the settings.There is already a
StorageInterface
https://github.com/piwik/piwik/blob/master/core/Settings/StorageInterface.php so if we are in Tracker mode we could set maybe another Storage for SystemSettingsThe text was updated successfully, but these errors were encountered: