   # Page snapshots
 
   saveSnapshot: ->
-    snapshot = @view.saveSnapshot()
-    @cache.put(@location, snapshot)
+    if @locationLoaded
+      snapshot = @view.saveSnapshot()
+      @cache.put(@location, snapshot)
 
   hasSnapshotForLocation: (location) ->
     @cache.has(location)

    @view = new Turbolinks.View this
    @cache = new Turbolinks.Cache 10
    @location = Turbolinks.Location.box(window.location)

  start: ->
    unless @started


  loadResponse: (response) ->
    @view.loadHTML(response)
    @locationLoaded = true
    @notifyApplicationOfPageChange()

  # Current request
