···204204 path := c.Request().URL.Path
205205 maxAge := 1 * (60 * 60) // default is 1 hour
206206207207- // Cache javascript and images files for 1 week, which works because
208208- // they're always versioned (e.g. /static/js/main.64c14927.js)
209209- if strings.HasPrefix(path, "/static/js/") || strings.HasPrefix(path, "/static/images/") || strings.HasPrefix(path, "/static/media/") {
210210- maxAge = 7 * (60 * 60 * 24) // 1 week
211211- }
212212-213213- // fonts can be cached for a year
214214- if strings.HasSuffix(path, ".otf") {
207207+ // all assets in /static/js, /static/css, /static/media are content-hashed and can be cached for a long time
208208+ if strings.HasPrefix(path, "/static/js/") || strings.HasPrefix(path, "/static/css/") || strings.HasPrefix(path, "/static/media/") {
215209 maxAge = 365 * (60 * 60 * 24) // 1 year
216210 }
217211