辅导案例-CS412

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
CAS CS412 PS5b: Cache
Let’s extend your Mongo / Redis skills.
Requirements
0. Create a new branch, PS5b. Be sure that your .gitignore file has an entry to
exclude /node_modules from being pushed to github. Create a new PS5b
directory to hold your work. For this assignment, you’re extending what you did in
PS4, so it makes sense to branch from there. There’s no testing requirement for
this assignment.
1. Refactor your Node app from PS4 to incorporate a simple redis cache. On the
first call to your route, your Node app should call your third-party API, then
store the result in redis before sending the response. Set the cache entry to
expire after 30 seconds.
2. Refactor your response to send a JSON object back to the client instead of
rendering a template. The response should include a field that indicates
whether the data came from cache or not.
3. On subsequent calls for the same search string, read the value from cache if it
present, otherwise go out to the API again.
4. Push your homework files to your GitHub repo.
5. Submit the GitHub repo/branch on Gradescope to complete the assignment.
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468