IssueRaiser

Feature request: option to update cache

**Problem Description** Currently, the cache action either restores an existing cache on cache-hit, or generates a missing cache on cache-miss. It does not update the cache on cache-hit. This works well for caching static dependencies, but not for caching build artefacts. **Proposed Solution** Add an option allowing the user to enable cache updates. This should be `false` by default to retain backwards-compatibility. ```yml uses: actions/cache@v2 with: path: ccache key: ${{ matrix.CONFIG }}-${{ matrix.CXX }}-${{ matrix.TYPE }} update: true # <~~ explicitly request an update ``` **Motivation** Some programming languages benefit greatly from build caching. C++ in conjunction with ccache is the prime example. Using caching commonly decreases compilation times by at least 70%. Medium-sized projects easily take 20 minutes to compile. ccache also manages the cache size itself and automatically removes obsolete entries, thus the cache won't explode with continuous updates. It also saves time and money for both user and provider. The environment will be happy too.

Posted by fsimonis on Jun 2, 2020, 3:17 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

github (Other)

Feature request: option to update cache

fsimonisJun 2, 2020, 3:17 PM

**Problem Description** Currently, the cache action either restores an existing cache on cache-hit, or generates a missing cache on cache-miss. It does not update the cache on cache-hit. This works well for caching static dependencies, but not for caching build artefacts. **Proposed Solution** Add an option allowing the user to enable cache updates. This should be `false` by default to retain backwards-compatibility. ```yml uses: actions/cache@v2 with: path: ccache key: ${{ matrix.CONFIG }}-${{ matrix.CXX }}-${{ matrix.TYPE }} update: true # <~~ explicitly request an update ``` **Motivation** Some programming languages benefit greatly from build caching. C++ in conjunction with ccache is the prime example. Using caching commonly decreases compilation times by at least 70%. Medium-sized projects easily take 20 minutes to compile. ccache also manages the cache size itself and automatically removes obsolete entries, thus the cache won't explode with continuous updates. It also saves time and money for both user and provider. The environment will be happy too.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue