asp.net - How to handle Caching before it has been set and multiple users access the website at the same time -


i have set caching website, expires after hour. problem if cache not exist , multiple users access website @ same time avoid users making same request @ same time. has impact on cpu usage @ 100% longer period of time.

i using system.runtime.caching.memorycache.

mvc asp.net application.

i have thought of solution not sure how best implement it, thoughts are,

one of many users first come in first, , start request , set flag fetching data , after more users come in shown no cache has been set before starting request check flag if request has been triggered. if has application should wait until response has come (is possible?), , use response cache. way 1 request sent , quicker response service , quicker response , cpu usage still quite low.

please suggest alternative this, idea wrong

can please advise?

thanks


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -