实现基础的206 partial content缓存

This commit is contained in:
GoEdgeLab
2022-03-03 19:36:28 +08:00
parent 6984257224
commit 619407f9e4
39 changed files with 1139 additions and 271 deletions

View File

@@ -52,8 +52,9 @@ func TestMatchBytesCache_WithoutCache(t *testing.T) {
func BenchmarkMatchStringCache(b *testing.B) {
runtime.GOMAXPROCS(1)
data := strings.Repeat("HELLO", 512)
regex := re.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`)
var data = strings.Repeat("HELLO", 512)
var regex = re.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`)
//b.Log(regex.Keywords())
_ = MatchStringCache(regex, data)
for i := 0; i < b.N; i++ {