   xhr.send()
 
 fetchHistory = (state) ->
-  cache = historyCache[state.position]
-  if cache
+  if cache = historyCache[state.position]
     replaceBody cache.body, cache.title
     triggerPageChange()
   else

initialized = false
historyCache = []

visit = (url) ->
  if browserSupportsPushState? and document.location.href != url
    rememberInitialPage()
    reflectNewUrl url
    fetchReplacement url

    document.location.href = url

rememberInitialPage = ->
  unless initialized
    window.history.replaceState { turbolinks: true, position: window.history.length - 1 }, "", document.location.href
    historyCache[window.history.state.position] = url: document.location.href, body: document.body, title: document.title
    initialized


fetchReplacement = (url) ->
