I need to keep a counter for couple of pages that each user visits. 

Lets say I need to keep counter for page 1 and 2. UserA visits page 1 for 10 times therefore its counter should be 10, and 
userB visits page 1 for 5 times and page 2 for 7 times so user's counter for page 1 should be 5 and page 2 should be 7.

```
CounterTable ( shows number of times that each page has been visited by each user)

 Username Page Counter
 A         1    10
 B         1    5
 B         2    7

```

To achieve this, I have a table in DB which keep the usernames, page numbers and counters, every time that user visits a page the associated counter in db will be incremented.

My question is that, if I increment the required counter, every time that I want to retrieve the pages (1 or 2) the user needs to wait for the application to get the required record updated before visiting the page. 

To avoid this, should I use JMS to send asynchronous requests to increment the counters in database? Another option, is to use ajax maybe to send async request to the server.

Is there any more efficient method to do it? if not which one is more efficient?