diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-05-17 17:06:47 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-06-04 16:07:39 +0200 |
commit | 447108fed2842e264897659856e9fd9cdc32ca23 (patch) | |
tree | 53687693e04496919dd84266cc1edc16746101b0 /resources/resource_spec.go | |
parent | c71e24af5172e230baa5f7dfa2078721cda38df4 (diff) | |
download | hugo-447108fed2842e264897659856e9fd9cdc32ca23.tar.gz hugo-447108fed2842e264897659856e9fd9cdc32ca23.zip |
Add a HTTP cache for remote resources.
Fixes #12502
Closes #11891
Diffstat (limited to 'resources/resource_spec.go')
-rw-r--r-- | resources/resource_spec.go | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/resources/resource_spec.go b/resources/resource_spec.go index 644259e48..ef76daa1a 100644 --- a/resources/resource_spec.go +++ b/resources/resource_spec.go @@ -29,6 +29,7 @@ import ( "github.com/gohugoio/hugo/common/hexec" "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/common/paths" + "github.com/gohugoio/hugo/common/types" "github.com/gohugoio/hugo/identity" @@ -53,6 +54,8 @@ func NewSpec( logger loggers.Logger, errorHandler herrors.ErrorSender, execHelper *hexec.Exec, + buildClosers types.CloseAdder, + rebuilder identity.SignalRebuilder, ) (*Spec, error) { conf := s.Cfg.GetConfig().(*allconfig.Config) imgConfig := conf.Imaging @@ -87,10 +90,12 @@ func NewSpec( } rs := &Spec{ - PathSpec: s, - Logger: logger, - ErrorSender: errorHandler, - imaging: imaging, + PathSpec: s, + Logger: logger, + ErrorSender: errorHandler, + BuildClosers: buildClosers, + Rebuilder: rebuilder, + imaging: imaging, ImageCache: newImageCache( fileCaches.ImageCache(), memCache, @@ -111,8 +116,10 @@ func NewSpec( type Spec struct { *helpers.PathSpec - Logger loggers.Logger - ErrorSender herrors.ErrorSender + Logger loggers.Logger + ErrorSender herrors.ErrorSender + BuildClosers types.CloseAdder + Rebuilder identity.SignalRebuilder TextTemplates tpl.TemplateParseFinder |