admin管理员组

文章数量:1402398

So my question is very simple. If I will perform the same query a lot of time per second/minutes (like User.find(test_user_id)) it will send request to database each time or it's just cache query result somehow?

So my question is very simple. If I will perform the same query a lot of time per second/minutes (like User.find(test_user_id)) it will send request to database each time or it's just cache query result somehow?

Share Improve this question asked Feb 15, 2014 at 22:39 Ph0en1xPh0en1x 10.1k8 gold badges55 silver badges97 bronze badges 1
  • Sequelize doesn't do any DB caching, but I love this module for Redis cache npmjs./package/sequelize-redis-cache – Mustafa Magdi Commented Apr 20, 2015 at 13:39
Add a ment  | 

1 Answer 1

Reset to default 4

In your example, User.find(test_user_id), User is the database table model you are querying and .find is your data retrieval method. From the sequelize site the finder method is defined as follows:

"Finder methods are designed to get data from the database."

If you call User.find(...) you will be querying your database for each query request.

本文标签: javascriptDoes sequelize cache common requestsStack Overflow