Updated: Comment #N
Problem/Motivation
The views output cache contains alot of stuff. It used to be ok, as it contained a rendered string for the view. However, this now stores a render array for the view data instead. Which mainly consists of a full ViewExecutable object (with build state etc..), the View entity storage, and all of the plugins too. So many classes...
So when the cache is loaded, a view instance is obviously created/loaded to then be able to get the cache settings, and subsequently load from cache. But the cached data contains the render array (mentioned above) that populates the display handler output property. So this populates the output #view property with the unserialized object from cache. Long story short - This is not the same view instance as the current one that has asked for the cache (The instance the view thinks it has).
Proposed resolution
Decide on the best strategy to not cache all of these instances. Just try to store what we need, and populate any state we need.
Remaining tasks
Decide, patch, tests.
User interface changes
None
API changes
Not sure, but likely this is pretty much all internal to views.
Comments
Comment #1
damiankloip commentedComment #2
dawehnerComment #11
catchThis is no-longer relevant after #2381277: Make Views use render caching and remove Views' own "output caching".