Patch #1321
closedPrecache all settings
0%
Description
While setting up my local development environment to have a look at bug #1313, I noticed that the database was hit multiple times to read settings - once per setting. This seems like an awfully stupid thing to do, as multiple settings usually need to get read anyways.
Also, there is a caching mechanism in place, but it only works for multiple reads of the same value per request. Also, there is code to check for settings cache freshness and flushing the cache, but the cache-flushing function is called once per request and the cache works for one request only anyways.
This lead me to devise the two attached patches. One (0001) preloads all settings into another class variable, the other (0002) gets rid of all the caching as it is not needed any more due to the settings being preloaded anyways.
This could be further improved by batch-loading the needed settings but it would require them to be known beforehand, otherwise we would get the old behaviour.
I know it's cosmetics, but still...
Files