Drop per-pipeline transformation cache #9459
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was extracted from the db2 branch. As discussed in previous core team meetings, this removes the per-pipeline transformation cache. This is only hit when:
Other cases are already handled by the request graph which won't even run an asset request that isn't invalidated.
Given the limited cases where it would be hit, the transformation cache results in a lot of complexity and issues. It is difficult if almost impossible to compute the cache keys for transformations ahead of time. You need to know all of the files, configs, dev dependencies, options, environment variables, etc. that will be used when doing a build for an asset, all of which require the request graph to know, so the transformation cache couldn't even be used standalone. In addition there were some bugs because it's hard to associate each of these to the correct plugins, especially dev dependencies which are be loaded on demand. For these reasons, we decided to remove the transformation cache and just rely on the request graph to know when to rebuild.
One other benefit of this change is that each asset only has one key in the cache now, whereas previously the cache would grow unbounded as changes were made.
In the future perhaps we can find other ways to address the above cases if we find this change results in widespread performance regressions.