_count vs track_total_hits

in my Elasticsearch index there are around 10M document, pagination based query is happening on this, on UI need to show total count of document matching query along with some data in page-format, there are 2 approach for showing count

  1. track_total_hits set as true in request
  2. make a count based query separately

which one is better? I think using separate count based query would be better as count also would be cached using request cache, while for track_total_hits with each request it need to re-calculate count again even if user move to the next page. am I correct?

for such decision making do I need to consider approx. how many pages each users checks?

I'd use track_total_hits as it will be much easier to implement.
But: are you sure the user needs to click randomly on page 948 to read some records?

What is the exact use case?

I mean that most of time, knowing that you have more than 10 thousand hits is enough...

I need to show total count on UI. each time backend need to send count

Does this mean that your users need to know that their search requests returns "10 012 hits" instead of saying it returns "more than 10 000 hits"?
Google for example does not return this value.

Anyway, if your users absolutely need the exact number of hits, just add track_total_hits.