(cacheDir string)
| 27 | } |
| 28 | |
| 29 | func (c cacheKey) filePath(cacheDir string) string { |
| 30 | // URLs can have slashes or other characters we don't want the file system interpreting. So we just encode the path |
| 31 | // to a flat base64 filename. |
| 32 | filename := base64.URLEncoding.EncodeToString([]byte(c.urlPath)) |
| 33 | return filepath.Join(cacheDir, c.encoding, filename) |
| 34 | } |
| 35 | |
| 36 | func getCacheKey(encoding string, r *http.Request) cacheKey { |
| 37 | return cacheKey{ |