How to avoid fast page refresh in ASP.NET?

I have a page showing statistics for users, this cannot be cached because each user has different statistics, and there is a lot, so a real-time request must be made.

How to avoid overloading the database server when the user presses F5 to update or ask different requests for short periods of time?

+4
source share
2 answers

I think @Jens A. is halfway - this is an ideal case for caching, calculating statistics, pasting them into a cache with a fixed expiration time, and then only calculating if they are not in the cache. Having an expiration time corresponding to the corresponding value (5 minutes, less?), The statistics will continue to be quite relevant and will change (update) intelligently without having to calculate each time the pages are constantly updated.

+2
source

You can save the generated statistics in your database for some time and simply show the old values ​​if the statistics are requested again.

+2
source

Source: https://habr.com/ru/post/1307519/


All Articles