mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
new handlers for client (i.e browser) catching: cache.NoCache and cache.StaticCache including tests
Former-commit-id: 18975297c8b96c7f9d5ff757f92051f6b10933c1
This commit is contained in:
5
cache/cache_test.go
vendored
5
cache/cache_test.go
vendored
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/cache"
|
||||
"github.com/kataras/iris/cache/client"
|
||||
"github.com/kataras/iris/cache/client/rule"
|
||||
|
||||
"github.com/kataras/iris"
|
||||
@@ -84,7 +85,7 @@ func runTest(e *httpexpect.Expect, path string, counterPtr *uint32, expectedBody
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestNoCache(t *testing.T) {
|
||||
func TestClientNoCache(t *testing.T) {
|
||||
app := iris.New()
|
||||
var n uint32
|
||||
|
||||
@@ -94,7 +95,7 @@ func TestNoCache(t *testing.T) {
|
||||
})
|
||||
|
||||
app.Get("/nocache", cache.Handler(cacheDuration), func(ctx context.Context) {
|
||||
cache.NoCache(ctx) // <----
|
||||
client.NoCache(ctx) // <----
|
||||
atomic.AddUint32(&n, 1)
|
||||
ctx.Write([]byte(expectedBodyStr))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user