Provides recommendations to be consumed by Firefox for Android.
Express is the Node framework, Apollo Client is used in Express to request data from Client API.
Because all Firefox Android clients will be hitting this endpoint, caching is very aggressive.
In AWS (but not for local development), our cache header on the Express endpoint is 'Cache-control', 'public, max-age=1800'
. We also have a CDN in place which respects this cache header, meaning the most frequent the underlying service will be hit is every 30 minutes.
As of this writing (2021-08-19), the underlying recommendation service will update at most every hour. We have chosen a 30 minute cache for practicality (a faster expire time just in case), and performance reasons (2 service hits per hour is well within our application service limits).
Clone the repo:
git clone git@github.com:Pocket/firefox-android-home-recommendations.git
cd firefox-android-home-recommendations
Install the packages:
npm install
Test are run via npm
commands:
- Unit/functional:
npm test
- Run
npm run start:dev
. - Load up
http://localhost:4005
in your browser. There you go.