JS Pagination/JSON Conern. Coding practices
<p>Currently, I am pre-caching a data set with a max limit of 500. Basically, Ajax goes and fetches all of the data. Front load it, and then create pagination etc.. all is good.</p>

<p>Problem - We are switching backend architecture and now the system can only feed us back 100 at a time. Given the current js front end implementation I can configure this, but after a 100, they get a message to "refine their search". When "500" was the return, that was ok. But now, they want to get the full count of 500, display pagination BUT go and fetch groupings of 100 as they are requested. </p>

<p>My concern. Because this data, now, is bucketed into 3 seperate data sets. Local , National, International. When I front load the 500, all is good. But, by getting 100 at a time now, I am really not sure how to do this.</p>

<p>See.. the pagination is like so.</p>

<p>arrowleft - 1 | 2 | 3 | 4 | 5 | 6 - arrowright</p>

<p>Now, with the new methodology, when they click on two - I go requests the second set of 100. Great. I can just postpend the data into my already created bucket. Ok, not so fast. What if they select "4", or "6". It is out of order. Also, what happens when any particular page has lets say (as an example).</p>

<p>User enters page. First 100 load. 
Data is as follows, in total.</p>

<pre><code>Local - 150 items
National - 220 items 
international - 300 items
</code></pre>

<p>The way the current pagination works is, all local is first, after that, then National, then International. This way, every subsequent page is just a lead off from the previous.</p>

<p>If a user, with the new system, clicks out of sequence... What is the protocal/way to gather that data and do what with it. You see my quandry? It is out of order. Should I not worry about "caching" this data, but just display it as they request it and throw it away once they leave the page?</p>
