Skip to content

REST API endpoint for Firefox Android home recommendations

License

Notifications You must be signed in to change notification settings

Pocket/firefox-android-home-recommendations

Repository files navigation

Firefox Android Home Recommendations API

Provides recommendations to be consumed by Firefox for Android.

Application Overview

Express is the Node framework, Apollo Client is used in Express to request data from Client API.

Caching

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).

Local Development

Fresh Setup

Clone the repo:

  • git clone git@github.com:Pocket/firefox-android-home-recommendations.git
  • cd firefox-android-home-recommendations

Install the packages:

  • npm install

Running Tests

Test are run via npm commands:

  • Unit/functional: npm test

Testing Client API

  • Run npm run start:dev.
  • Load up http://localhost:4005 in your browser. There you go.

About

REST API endpoint for Firefox Android home recommendations

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published