Skip to content

Skip restoring the cache if it's going to be invalidated later anyway #1676

@edmorley

Description

@edmorley

Currently the Python related cache contents are always restored to the build directory, even if the contents are going to be invalidated/deleted later, which (a) wastes time copying files that aren't used, (b) leads to the current mess of the cache handling throughout the buildpack mixing and matching cache dir vs build dir references.

We should perform cache invalidation up front (against the files in their cache dir location), and only if we're reusing the caches content should it be copied back to the build directory.

Note: Making this change will require moving cache restoration to after the bin/pre_compile hook stage, since the cache handling depends on the package manager and Python version calculation steps having already been performed (which themselves must occur after the bin/pre_compile hook, so that it can write out package manager files if needed etc).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions