mirror of
https://github.com/kataras/iris.git
synced 2026-01-03 10:17:03 +00:00
New iris.DirOptions.PushTargetsRegexp
rel to: https://github.com/kataras/iris/issues/1562#issuecomment-659702891 Former-commit-id: 778cf9146b730d424040ea9e259ce6500f53b563
This commit is contained in:
@@ -2,6 +2,7 @@ package iris
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"regexp"
|
||||
|
||||
"github.com/kataras/iris/v12/cache"
|
||||
"github.com/kataras/iris/v12/context"
|
||||
@@ -216,6 +217,13 @@ var (
|
||||
ctx.CompressReader(true)
|
||||
ctx.Next()
|
||||
}
|
||||
|
||||
// MatchCommonAssets is a simple regex expression which
|
||||
// can be used on `DirOptions.PushTargetsRegexp`.
|
||||
// It will match and Push
|
||||
// all available js, css, font and media files.
|
||||
// Ideal for Single Page Applications.
|
||||
MatchCommonAssets = regexp.MustCompile("((.*).js|(.*).css|(.*).ico|(.*).png|(.*).ttf|(.*).svg|(.*).webp|(.*).gif)$")
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user