-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Description
This relates to #14416 when using e.g. version = "<v3.0.0" in your module import. This is very useful, but since Go needs to recalculate the correct version on every Hugo build, it's slow.
Go has a API to take in a cached JSON response, so this should be relatively simple to implement.And well worth it.
I suspect that people would want to control the expiry of this, so I suggest we make it its own cache, so I suggest:
- A new file cache named
modulequerieswith:- dir = ':cacheDir/modulequeries'
- maxAge = '24h'
This means that in downloadModuleVersion:
- Create a key using
path+version - Check file cache, if it exists, pass the filename as
-reuseargument to download. - Store the returned JSON in the file cache.
Reactions are currently unavailable