Redis calls the API in js to count and incr twice each time.

the value taken out each time is 2. Why
but the fiddler grab package also shows that it was only called once. There is no record of two calls.
this happens only in js, but not if you open the interface address in the browser.

Mar.20,2021

did you trigger $.post to submit this through the click event? it may be because the quick click called it twice; or if the value you open is 1, then it is normal to return 2 because incr returns the value after executing the command


the page where js is located and your interface address is not a cross-domain relationship, is it? If it is cross-domain, jq will initiate two requests, one for OPTION and one for POST.

< hr >

beside the point, it's not impossible for you to use string, for redis, that is, how many key will be exhausted when you manage them yourself, and it's not easy to rank keywords. Recommend hash set or ordered set

.
Menu