简体   繁体   English

是否继续缓存常见请求

[英]Does sequelize cache common requests

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? 如果我将每秒/分钟执行相同的查询很多时间(如User.find(test_user_id)),它每次都会向数据库发送请求,或者只是以某种方式缓存查询结果?

In your example, User.find(test_user_id), User is the database table model you are querying and .find is your data retrieval method. 在您的示例中,User.find(test_user_id),User是您要查询的数据库表模型,.find是您的数据检索方法。 From the sequelize site the finder method is defined as follows: sequelize站点 ,finder方法定义如下:

"Finder methods are designed to get data from the database." “Finder方法旨在从数据库中获取数据。”

If you call User.find(...) you will be querying your database for each query request. 如果您调用User.find(...),您将查询每个查询请求的数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM