DEV Community

Discussion on: A simple caching strategy for Node REST APIs, Part 1

Collapse
 
namthang_ng profile image
Nguyễn Nam Thắng

Can you explain the processQuery, responseHandler fuction for me.

Collapse
 
vigzmv profile image
Vignesh M

Hey, processQuery & responseHandler are not anything related to caching or have anything to do with this artcle. They are just examples of common middlewares.


In our app, processQuery transforms some of our url query params, does some checks if they are valid.

responseHandler just converts the response data to json and returns a 200 status.
This may not be everyone's usecase.

Collapse
 
namthang_ng profile image
Nguyễn Nam Thắng

thank bro

Collapse
 
namthang_ng profile image
Nguyễn Nam Thắng

Thank you. Do you still have this tutorial. i don't see it on your github