fake-news-detector / api

API for saving news flagging by the users
https://fake-news-detector-api.herokuapp.com/
8 stars 1 forks source link

Add caching headers #7

Closed rogeriochaves closed 6 years ago

rogeriochaves commented 6 years ago

Currently each request is a new one for the server, even if you pass through the same news twice.

For the Fake News Detector, always fresh responses are not very important, therefore, we could add a Cache-Control header and ask the browser to cache it for at least some hours.

Later, we can put a layer in front of it like Cloudflare and ask it to use the headers to cache our response, so duplicated requests from different users wouldn't also hit our server.

This would protect us from having a lot of duplicated requests for some sudden popular news for example.

I don't know how to do this on Rocket, I need help.

rogeriochaves commented 6 years ago

Fixed by #16