There was an error while loading. Please reload this page.
1 parent dbe6397 commit 6cd33f6Copy full SHA for 6cd33f6
tpl/data/cache.go
@@ -14,8 +14,9 @@
14
package data
15
16
import (
17
+ "crypto/md5"
18
+ "encoding/hex"
19
"errors"
- "net/url"
20
"sync"
21
22
"github.com/gohugoio/hugo/config"
@@ -27,7 +28,8 @@ var cacheMu sync.RWMutex
27
28
29
// getCacheFileID returns the cache ID for a string.
30
func getCacheFileID(cfg config.Provider, id string) string {
- return cfg.GetString("cacheDir") + url.QueryEscape(id)
31
+ hash := md5.Sum([]byte(id))
32
+ return cfg.GetString("cacheDir") + hex.EncodeToString(hash[:])
33
}
34
35
// getCache returns the content for an ID from the file cache or an error.
0 commit comments