I am building a search website, which will have results displayed using pagination. I am trying to figure out the best way to implement pagination of these results.
User searches for abcd in my website. I take him to the URL www.mydomain.com?search=abcd which has (say) 45 search results and I show him the first 10 and links to page2, page3, page4 and page5.
Approach 1: Once the user clicks on page2, I redirect him to www.mydomain.com?search=abcd&page=2 which displays the next 10 results.
Approach 2: Once the user clicks on page2, I do an AJAX call, get the next 10 results in JSON/XML format and reload just the results section instead of entire page. The browser URL won't change.
Approach 2 gives a good user experience because of just the section reload. But in Approach 2, if the user likes page2 results and saves/shares that browser URL, the URL will always lead him to page1. Also in approach 2, I have to build an additional RESTFUL service for the next page results.
*Which approach is better considering all factors? What is the standard way of pagination?*