balupton/history.js — Issue #154: understanding pushstate / replacestate with ajax loading (infinite scroll)
Author: Cyriltra
Created: 2012-02-02 08:52:36+00:00
State: open

Hello,

Im using an infinite scroll feature to display images. A user can click on the images to get more details related to it.
I would like to use History to allow users to navigate backward and resume their infinite scrolling.
But here I expect the following behaviour:
Once the user click on go back button, I want him to return on the previous page with all the content previously loaded and without doing any extra ajax query. Is it possible ? How to use the cache system ?

or if this is not possible, I guess I must code it, meaning if a user left on page 5, after hitting back page button, i need to dynamically load page 1, 2, 3, 4 and 5. But this might take a while, especially if the users goes to page 100 (easily reachable with infinite scroll).

or I guess the best solution is to only dynamically load the page 5, but yet the users is losing all the previously loaded content.

Thank you for your help