title: Http Performance - Many small requests or one big one
body: <p><strong>Scenario:</strong></p>
  
  <ol>
  <li>In my site I display books. </li>
  <li>The user can add every book to a "Read Later" list. </li>
  </ol>
  
  <p><strong>Behavior:</strong></p>
  
  <p>When the user enters the site, they are presented with a list of books. 
  Some of which are already in their "Read Later" list, some aren't. </p>
  
  <p>The user has an indication next to each book telling them whether the book has been added to the list or not. </p>
  
  <p><strong>My issue</strong></p>
  
  <p>I am debating which option is the ideal for my situation.</p>
  
  <p><strong>Option 1:</strong></p>
  
  <ol>
  <li>For every book, query the server whether it already exists in the user's list. </li>
  <li>Update the indicator for each book.</li>
  </ol>
  
  <p><strong>Pro:</strong>
  Very small request to the server, and very easy response (true or false).</p>
  
  <p><strong>Con:</strong> In a page with 30 books, I will send 30 separate http requests, which can block sockets, and is rather slow considering the browser and the server have to perform the entire handshake for each transaction. </p>
  
  <p><strong>Option 2:</strong></p>
  
  <ol>
  <li>I query the server once, and get a response with the full list of books in the "Read Later" list as an array.</li>
  <li>In the browser, I go over the array, and update the indication for each book based on whether it exists in the array or not. </li>
  </ol>
  
  <p><strong>Pro:</strong> I only make one request, and update the indicator for all the books at once.</p>
  
  <p><strong>Con:</strong> The "Read Later" list might have hundreds of books, and passing a big array might prove slow and excessive. Especially in scenarios when not 30 books appear on the screen, but only 2-3. (That is, I want to check if a certain book is in the list, and for this I have the server send the client the entire list of books from the list).</p>
  
  <p><strong>So,</strong></p>
  
  <p>Which way would you go to maximize performance: 1 or 2?</p>
  
  <p>Is there any alternative I am missing? </p>