         page.html = xhr.responseText
         @loadPage page
         Pjax.clearCache page.url
-      success: (result) =>
+      success: (result, status, xhr) =>
         page.html = $.trim result
         page.name = ''
+        if pageUrl = xhr.getResponseHeader 'X-PJAX-URL'
+          page.url = simple.url(pageUrl).toString('relative')
         @loadPage page
 
   loadPage: (page) ->

    Pjax.pageCache[page.url] = page
    page

  getCache: ->
    Pjax.pageCache[@url.toString('relative')]

  @clearCache: (url) ->
    if url

          @request.abort()
          @request = null

        page = @getCache state.url
        return unless page

        @el.html page.html
        @el[0].offsetHeight
        @pageTitle state.name
        #@requestPage state
