Skip to content

Commit

Permalink
feat: change the regex to cover all static assets
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodallacqua-hpe committed Mar 10, 2023
1 parent 7013a06 commit 39d4947
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion master/internal/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,8 @@ func (m *Master) Run(ctx context.Context) error {

// Files that receive a unique hash when bundled and deployed can be cached forever
// Other static files should only be cached for a short period of time
cacheFileLongTerm := regexp.MustCompile(`(^(index|vendor)|.(chunk\.(css|js)|woff2|woff)$)`)
// (?:(^(index|vendor))[-a-z\d]($\.((css|js)|woff2|woff)))
cacheFileLongTerm := regexp.MustCompile(`(-[0-9]{1,}\.(js|css))$|(woff2|woff)$`)
cacheFileShortTerm := regexp.MustCompile(`.(antd.\S+(.css)|ico|png|jpe*g|gif|svg)$`)

if cacheFileLongTerm.MatchString(requestedFile) {
Expand Down

0 comments on commit 39d4947

Please sign in to comment.