Cache dictionaries
There is some cost to dictionaries, so it seems to be worth caching them (especially with .dic
+.aff
).
Implementation
Dictionaries will go to a specific directory and actions/cache will track the directory.
The dictionary retrieval code can choose to skip retrieving any file(s) it already has.
ℹ️ Caching is not implemented as of v0.0.23. You could merge a number of dictionaries into a single file and reference it instead if you believe the performance of downloading a bunch of dictionaries in parallel is problematic. At the time of the release of v0.0.23, the behavior of actions/cache was sufficiently problematic that all caching code was removed.
Invalidation
Each dictionary's ETAG will be stored.
Use the ETAG to retrieve (or not) the content.
The code doesn't currently handle the case that there is no etag from the server, that should be added (in the interim, please use servers that generate etags...)
Clearing cache entries manually
Programmatically
- You can get a list of caches using actions/cache: list-github-actions-caches-for-a-repository
- You can delete a cache entry by id using actions/cache: delete-a-github-actions-cache-for-a-repository-using-a-cache-id
Interactively
Caches are accessible below workflows on the actions page of each repository and can be deleted directly.
Storage
There have been a couple of iterations so far... Layouts 1 and 2 (with etags) don't handle collisions in dictionary names particularly well...
Proposed layout
dictionary/
- {sha}/
- {extension}
- ...
urls/
- {random}/
- raw.url
- resolved.url
- etag
- sha
- ...
Approach
-
Given a new unresolved url.
-
Resolve it.
-
Check
urls/*/resolved.url
to see if it is already present (=> 6). -
Create
urls/{random}
. -
Write
raw.url
andresolved.url
to the directory. -
Use the matching
urls/{random}
directory. -
Use the etag (if available) to see if it's current (=> done).
-
Save the file to a temp.
-
Calculate the sha.
-
Write the new
etag
andsha
to the directory (from 6). -
Write
dictionary/{sha}/{extension}
({sha}
from 9,{extension}
from 2).
Cleanup after all resolution is done
- detect any
directory/{sha}
for which there is no urls/{*}/sha containing that value and delete it. - detect any
urls/{*}/sha
for which there's more than oneurls/{*}
with the samesha
file value and warn about it.
FAQ | Showcase | Event descriptions | Configuration information | Known Issues | Possible features | Deprecations | Release notes | Helpful scripts