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


  locationChangedByActor: (location, actor) ->
    @saveSnapshot()
    @location = location
    @adapter.locationChangedByActor(location, actor)


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

  start: ->
    unless @started
