Caching commonly used database data in MVC 4 site

2019-09-09 05:36发布

I have some commonly used data in my MVC 4 application like;

Countries
Region
City
District Hotels

This data rarely changes, although occasion updates do occur in my MySQL database. My questions related to this are;

  1. Is it recommended to cache this data when IIS starts the site service
  2. How best should this data be stored if this is a recommended technique.
  3. How best should I update this data should it be changed in the database (MySQL), without restarting the website.

Note that currently the City table contains over 50,000 rows, and the hotel table has over 350,000 rows of data.

Is it possible that I can read this data from the MySQL, initially one time only, and it is loaded into memory; rather than having to read from the database every time the information is needed.

0条回答
登录 后发表回答