Skip to content

Commit

Permalink
cacheが有効なときのみ304を見る
Browse files Browse the repository at this point in the history
  • Loading branch information
catatsuy committed Feb 28, 2016
1 parent 1ef7067 commit 35ce11e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions benchmarker/checker/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func (a *Action) PlayWithImage(s *Session) error {
req.Header.Add(key, val)
}

urlCache, found := cache.GetInstance().Get(a.Path)
if found {
urlCache, cacheFound := cache.GetInstance().Get(a.Path)
if cacheFound {
urlCache.Apply(req)
}

Expand All @@ -139,7 +139,8 @@ func (a *Action) PlayWithImage(s *Session) error {

success := false

if res.StatusCode == http.StatusNotModified {
// キャッシュが有効でかつStatusNotModifiedのときは成功
if cacheFound && res.StatusCode == http.StatusNotModified {
success = true
}

Expand Down

0 comments on commit 35ce11e

Please sign in to comment.