CodeWritingCow / NYC-restaurant-inspection-records

Web application for searching New York City restaurant inspection records
http://www.nycfoodsafety.org
1 stars 3 forks source link

Implement Redis caching #62

Closed CodeWritingCow closed 5 years ago

CodeWritingCow commented 5 years ago

Add Redis caching to POST route /search.

When a user searches for a restaurant's reports, our Node.js server checks whether the search query term exists inside our Redis cache.

If it doesn't, then the server fetches data from NYC Open Data API. The server then saves the query term as Redis cache key, with the API data as the cache value.

But if the search query term exists as a Redis key, then the server retrieves the saved data from the Redis cache.

CodeWritingCow commented 5 years ago

TODO: Refactor out repetitive code for DRY. The PR includes an unused function, getData(), for that purpose. However, it hasn't been tested.

badwolfbit commented 5 years ago

@CodeWritingCow do you have a getting started / documentation on this error of redisURL.js file?

Screen Shot 2019-08-29 at 6 03 29 PM
badwolfbit commented 5 years ago

@CodeWritingCow Thanks for sending the redisUrl.js file, still having issues to have the app running. Are you coming across this error on your local machine?

Screen Shot 2019-09-09 at 3 48 22 PM
badwolfbit commented 5 years ago

@CodeWritingCow everything looks good now resolved redisUrl.js w/ proper copy of the file

saw redis caching improvements (as shown below):

Screen Shot 2019-09-09 at 4 36 33 PM Screen Shot 2019-09-09 at 4 36 53 PM
CodeWritingCow commented 5 years ago

Thanks @omenwolf!