question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: option to update cache

See original GitHub issue

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.

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:130
  • Comments:15

github_iconTop GitHub Comments

29reactions
Vampirecommented, Aug 13, 2020

Maybe save as ccache-${{ github.run_id }} and restore with restore key ccache-. github.run_id is unique id for the workflow run, so every time a new cache is saved. When restoring you will never have an exact match but then the ccache- restore key will restore the latest one that started with that string and in the end create a new one with the current state.

14reactions
Vampirecommented, Aug 13, 2020

Nah, that’s merely a work-around. It will fill up your 5 GiB of cache and then evict things that might not have been evicted if the cache would have been updatable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

feature request: cache: 'auto' #306 - actions/setup-node - GitHub
I would like to request that "automatic detection" mode be supported for the cache option. The option would check whether the following ...
Read more >
Feature Request: Setting to cache firmware when updating
My understanding now is network devices need internet access to update firmware, it does not go through the controller unless you cache the...
Read more >
Manage Feature Cache—ArcGIS Pro | Documentation
The cache is automatically managed and as features are cached, the number of queries needed to retrieve data is reduced and drawing time...
Read more >
Request.cache - Web APIs | MDN
A RequestCache value. The available values are: default — The browser looks for a matching request in its HTTP cache.
Read more >
[Feature Request] Option to disable cache for certain file types
Say for example you we're debugging Javascript on an image heavy website (like ours), every time you refresh the page you remotely re-download ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found