OK, everyone, please help me think. I tried to explain it to my duck, but it wasn't in the mood.
Index class, we have a method
resetCaches() to reset all the caches pertaining to the index (in particular cached fields lists, properties, plugins, etc.). It has a parameter
$include_stored which, when set to
FALSE, will skip resetting the permanent, stored cache and just reset the cache properties on the index object itself.
However, here comes my question: if you do that, doesn't that just mean it that next time
getFields() is called (which uses both a static and stored cache) the stale data from the stored cache will be loaded into the static property and returned? Seems to me, this doesn't make any sense.
Please tell me if I'm missing something there.
Otherwise, to save performance, we should either use something like cache tags, to avoid clearing all caches when just one part has changed, and maybe also have some property during index save that disables the stored cache for a while (to avoid dozens of cache sets and deletes with no gain whatsoever). Or, in general, maybe try to be a lot more thorough in resetting caches exactly when necessary, neither more often nor rarer – just like Core did, which brought great benefits, too.
In any case, we shouldn't allow clearing one cache, but leaving the other with the old, stale data.
Estimated Value and Story Points
Value and Story points are in the scale of fibonacci. Our minimum is 1, our maximum is 21. The higher, the more value or work a certain issue has.
Story Points: 5